blob: 7870da8d6c61b67fba9746303a020e22158ee60f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity targ03 is
port (rdat : out std_logic_vector (7 downto 0);
rv : out std_logic;
wdat : std_logic_vector (7 downto 0);
wval : std_logic;
wen : std_logic;
clk : std_logic);
end targ03;
architecture behav of targ03 is
type memdat is record
d1 : std_logic_vector(7 downto 0);
v : std_logic;
end record;
begin
process (clk)
variable m : memdat;
begin
if rising_edge (clk) then
if wen = '1' then
m := (wdat, wval);
end if;
(rdat, rv) <= m;
end if;
end process;
end behav;
|