Regarding swords vs spears...
Once the swordsman is past the first rank's spear, and assuming the spearman can't use it to attack (and assuming further that they do not ignore the frenzied swordsman in front of them to strike at the 2nd sword rank), the 1st rank of spears will change to defence - using their mighty (but not necessarily very tough) shield as best they can, purely focussed on defending themselves. Meanwhile, ranks 2 and 3 of the spears are still attacking.
So not only does the swordsman have to try to down the spearman in front of him who is in full defence mode, he also has to dodge the pointy sticks of the men behind.
Still, I think that a sword is much more versatile (it can stab and slash, whereas traditional pointy sticks can only stab), and let's assume most swordsmen have a shield to help defend themselves as well.
I think that overall, the swords should win.
But I think that all units (especially, but not only, cavalry) should get certain penalties when charging the front of a spear unit. Say a free, higher-than-normal-value attack on every unit on the front rank, which is of greater value still against cavalry.
I mean, seriously, even foot-troops are taking considerable risk when running into the front of a wall of spears!