L
lundril
A question which I ran across:
Asume that I have two components.
For easier description lets assume that one is a CPU and the other one
is a RAM.
Usually the dataBus pins which connect the CPU to the RAM are
bi-directional.
Now if I want to build a testbench which contains the CPU component and
the RAM
component I have the following component declarations:
--------------------
.....
component cpu is
port (
....
dataBus : inout STD_LOGIC_VECTOR(7 downto 0); -- 8 Bit data bus
for example
...
);
end component;
component ram is
port (
....
dataBus : inout STD_LOGIC_VECTOR(7 downto 0); -- 8 Bit data bus
....
);
end component;
-- dataBus connection between cpu and ram
signal dataBus : STD_LOGIC_VECTOR(7 downto 0);
--------------------
I further assume that the cpu and ram components are completely
functional
models without any explicit delays in them.
now in the architecture body of my testbench I could use the following:
--------------------
cCpu : cpu
port map (
...
dataBus => dataBus
...
);
cRam : ram
port map (
...
dataBus => dataBus
...
);
------------------
This is ok as long as I don't want to simulate delays.
But what do I do if I want to add delays from the port of the cpu and
ram
components to the data bus in my testbench, without changing the
"cpu" or "ram" entities ?
I mean I could do something like this
--------------------------------------------
....
signal dataCpu : STD_LOGIC_VECTOR(7 downto 0);
signal dataRam: STD_LOGIC_VECTOR(7 downto 0);
begin
cCpu : cpu
port map (
...
dataBus => dataCpu
...
);
cRam : ram
port map (
...
dataBus => dataRam
...
);
dataRam <= dataCpu after 5 ns;
dataCpu <= dataRam after 5 ns;
-------------------------------------------------------
But this (of course) doesn't work.
Any ideas ?
so long
lundril
Asume that I have two components.
For easier description lets assume that one is a CPU and the other one
is a RAM.
Usually the dataBus pins which connect the CPU to the RAM are
bi-directional.
Now if I want to build a testbench which contains the CPU component and
the RAM
component I have the following component declarations:
--------------------
.....
component cpu is
port (
....
dataBus : inout STD_LOGIC_VECTOR(7 downto 0); -- 8 Bit data bus
for example
...
);
end component;
component ram is
port (
....
dataBus : inout STD_LOGIC_VECTOR(7 downto 0); -- 8 Bit data bus
....
);
end component;
-- dataBus connection between cpu and ram
signal dataBus : STD_LOGIC_VECTOR(7 downto 0);
--------------------
I further assume that the cpu and ram components are completely
functional
models without any explicit delays in them.
now in the architecture body of my testbench I could use the following:
--------------------
cCpu : cpu
port map (
...
dataBus => dataBus
...
);
cRam : ram
port map (
...
dataBus => dataBus
...
);
------------------
This is ok as long as I don't want to simulate delays.
But what do I do if I want to add delays from the port of the cpu and
ram
components to the data bus in my testbench, without changing the
"cpu" or "ram" entities ?
I mean I could do something like this
--------------------------------------------
....
signal dataCpu : STD_LOGIC_VECTOR(7 downto 0);
signal dataRam: STD_LOGIC_VECTOR(7 downto 0);
begin
cCpu : cpu
port map (
...
dataBus => dataCpu
...
);
cRam : ram
port map (
...
dataBus => dataRam
...
);
dataRam <= dataCpu after 5 ns;
dataCpu <= dataRam after 5 ns;
-------------------------------------------------------
But this (of course) doesn't work.
Any ideas ?
so long
lundril