M
MikeWhy
Guest
What's the big deal about a latch? Is it less efficient in floorspace than
an FDE? Or is it just some amount of combinatorial concerns? For example:
tsc_start <= tsc when sof_in_n = '0' and rising_edge(clk);
versus
tsc_start <= tsc when sof_in_n = '0';
What concerns are there with crossing clock domains with either? For
example, a 10 ns tick clock would be more directly meaningful than, say, a
125 MHz clock in this application. (The logic reading the value runs on a
different clock than the logic updating the value.)
Also, I had apparently missed the explanation of the semantic difference
between 'to' and 'downto'. Does simple intuition apply here, that with 'to',
low indexes reference the more significant bits or words?
Last, does the following infer a multiplier and adder in synthesis? I
wouldn't expect to see one, and didn't see one in the synthesis log or RTL
schematic, but the whole thing got really messy with simply adding the very
wide registers.
function w_tsc(val : std_logic_vector; i : natural) return
std_logic_vector is
variable lo : natural := i * 8;
variable hi : natural := lo + 7;
begin
return val(hi downto lo);
end function;
begin -- arch
with tx_state select
dout <= ....
w_tsc(tsc_start, 7) when SEND_TSC_START,
w_tsc(tsc_start, 6) when SEND_TSC_START_1,
w_tsc(tsc_start, 5) when SEND_TSC_START_2,
w_tsc(tsc_start, 4) when SEND_TSC_START_3,
w_tsc(tsc_start, 3) when SEND_TSC_START_4,
w_tsc(tsc_start, 2) when SEND_TSC_START_5,
...
Truly and finally last, is there a good way to generate the above, in the
midst of a selected assignment having other, unrelated states?
Thanks.
an FDE? Or is it just some amount of combinatorial concerns? For example:
tsc_start <= tsc when sof_in_n = '0' and rising_edge(clk);
versus
tsc_start <= tsc when sof_in_n = '0';
What concerns are there with crossing clock domains with either? For
example, a 10 ns tick clock would be more directly meaningful than, say, a
125 MHz clock in this application. (The logic reading the value runs on a
different clock than the logic updating the value.)
Also, I had apparently missed the explanation of the semantic difference
between 'to' and 'downto'. Does simple intuition apply here, that with 'to',
low indexes reference the more significant bits or words?
Last, does the following infer a multiplier and adder in synthesis? I
wouldn't expect to see one, and didn't see one in the synthesis log or RTL
schematic, but the whole thing got really messy with simply adding the very
wide registers.
function w_tsc(val : std_logic_vector; i : natural) return
std_logic_vector is
variable lo : natural := i * 8;
variable hi : natural := lo + 7;
begin
return val(hi downto lo);
end function;
begin -- arch
with tx_state select
dout <= ....
w_tsc(tsc_start, 7) when SEND_TSC_START,
w_tsc(tsc_start, 6) when SEND_TSC_START_1,
w_tsc(tsc_start, 5) when SEND_TSC_START_2,
w_tsc(tsc_start, 4) when SEND_TSC_START_3,
w_tsc(tsc_start, 3) when SEND_TSC_START_4,
w_tsc(tsc_start, 2) when SEND_TSC_START_5,
...
Truly and finally last, is there a good way to generate the above, in the
midst of a selected assignment having other, unrelated states?
Thanks.