S
Svenn Are Bjerkem
Guest
Hi,
tried to search for answer on something I don't quite understand, but
found little. Maybe I don't know the right keywords to search for:
In an SPI I have an internal data register called data_int which looks
like this:
process(clk,reset)
begin
if reset = '1' then
....
elsif rising_edge(clk) then
.....
data_int <= data_int(8 downto 0) & SDATA
.....
end if;
end process;
DATA <= data_int;
DATA and SDATA are ports on the entity and both DATA and data_int are
std_logic_vector(8 downto 0) and SDATA is serial data from slave SPI
of std_logic type.
When simulating with modelsim, I see that data_int is updated on the
rising edge of clk. data, on the other hand, is updated on the
following falling edge of clk. This I don't understand. I also tried
data <= data_int after 1 ns;
but that just delayed the update of data 1 ns after the falling edge
of clk. My code doesn't have any timing resolution statements, and I
don't know if modelsim has something by default, and I haven't found
anything about this half-cycle delay in any of the books I have.
Anybody have a pointer to what I am missing here?
--
Svenn
tried to search for answer on something I don't quite understand, but
found little. Maybe I don't know the right keywords to search for:
In an SPI I have an internal data register called data_int which looks
like this:
process(clk,reset)
begin
if reset = '1' then
....
elsif rising_edge(clk) then
.....
data_int <= data_int(8 downto 0) & SDATA
.....
end if;
end process;
DATA <= data_int;
DATA and SDATA are ports on the entity and both DATA and data_int are
std_logic_vector(8 downto 0) and SDATA is serial data from slave SPI
of std_logic type.
When simulating with modelsim, I see that data_int is updated on the
rising edge of clk. data, on the other hand, is updated on the
following falling edge of clk. This I don't understand. I also tried
data <= data_int after 1 ns;
but that just delayed the update of data 1 ns after the falling edge
of clk. My code doesn't have any timing resolution statements, and I
don't know if modelsim has something by default, and I haven't found
anything about this half-cycle delay in any of the books I have.
Anybody have a pointer to what I am missing here?
--
Svenn