Forum Discussion
Altera_Forum
Honored Contributor
12 years agoI am assuming here that you are talking directly to the PHY and aren't using a MAC. Although in that case I don't understand why you have a "startpacket" signal as it isn't a signal used with the PHY.
To answer your question you just send one word per clock cycle, so as long as clk is the same clock than the one used to communicate with the PHY, your method should be good. I have two other comments about your code: startpacket <= enableit;
tx_data <= preamble;
startpacket <= disableit;This is exactly equivalent to tx_data <= preamble;
startpacket <= disableit;The first line is useless as you overwrite the startpacket signal with disableit without delay. if SW(0) = '1' then
...
if (clk = '0') AND (last_clk = '1') thenI don't think this with synthesize properly, and it won't simulate properly because it will set tx_data back to preamble at each rising edge of the clock. And in any case it isn't the recommended way. The recommended way to design a clocked process is as follows: if falling_edge(clk) then -- or if (clk = '0') and clk'event then
...
if SW(0) = '1' then
...And you don't need to do separate things on the rising and falling edges of the clock. First Quartus doesn't know how to synthesize this, and second with a synchronous interface you can do everything on the same edge of the clock, including updating your counter value.