URL
https://opencores.org/ocsvn/vhdl_cpu_emulator/vhdl_cpu_emulator/trunk
[/] [vhdl_cpu_emulator/] [trunk/] [design_top_tb.vhd] - Blame information for rev 3
Details |
Compare with Previous |
View Log
| Line No. |
Rev |
Author |
Line |
| 1 |
2 |
nachumk |
library ieee;
|
| 2 |
|
|
library generics;
|
| 3 |
|
|
use ieee.std_logic_1164.all;
|
| 4 |
|
|
use ieee.numeric_std.all;
|
| 5 |
|
|
use ieee.std_logic_unsigned.all;
|
| 6 |
|
|
use generics.components.all;
|
| 7 |
|
|
use work.design_top_constants.all;
|
| 8 |
|
|
|
| 9 |
|
|
entity design_top_tb is
|
| 10 |
|
|
port(
|
| 11 |
|
|
clk : out std_logic_vector(1 downto 0);
|
| 12 |
|
|
rstN : out std_logic_vector(1 downto 0);
|
| 13 |
|
|
cpu_cs1 : out std_logic_vector(1 downto 0);
|
| 14 |
|
|
cpu_cs2 : out std_logic_vector(1 downto 0);
|
| 15 |
|
|
cpu_cs3 : out std_logic_vector(1 downto 0);
|
| 16 |
|
|
cpu_we : out std_logic_vector(1 downto 0);
|
| 17 |
|
|
cpu_a : out std_logic_vector(9 downto 0);
|
| 18 |
|
|
cpu_d : inout std_logic_vector(15 downto 0);
|
| 19 |
|
|
cpu_irq4 : in std_logic_vector(1 downto 0);
|
| 20 |
|
|
cpu_irq7 : in std_logic_vector(1 downto 0)
|
| 21 |
|
|
);
|
| 22 |
|
|
end design_top_tb;
|
| 23 |
|
|
|
| 24 |
|
|
architecture behavior of design_top_tb is
|
| 25 |
|
|
component cpu_sim is
|
| 26 |
|
|
port(
|
| 27 |
|
|
fname : in filename;
|
| 28 |
|
|
clk : out std_logic;
|
| 29 |
|
|
rstN : out std_logic;
|
| 30 |
|
|
cpu_cs1 : out std_logic;
|
| 31 |
|
|
cpu_cs2 : out std_logic;
|
| 32 |
|
|
cpu_cs3 : out std_logic;
|
| 33 |
|
|
cpu_we : out std_logic;
|
| 34 |
|
|
cpu_a : out std_logic_vector(4 downto 0);
|
| 35 |
|
|
cpu_d : inout std_logic_vector(7 downto 0);
|
| 36 |
|
|
cpu_irq4 : in std_logic;
|
| 37 |
|
|
cpu_irq7 : in std_logic
|
| 38 |
|
|
);
|
| 39 |
|
|
end component;
|
| 40 |
|
|
|
| 41 |
|
|
signal fnames : array2xfilename := (mk_filename("cpu1.txt"), mk_filename("cpu0.txt"));
|
| 42 |
|
|
|
| 43 |
|
|
begin
|
| 44 |
|
|
gen_blocks : for i in 0 to 1 generate
|
| 45 |
|
|
cpu_sim_inst : cpu_sim port map(
|
| 46 |
|
|
fname => fnames(i),
|
| 47 |
|
|
clk => clk(i),
|
| 48 |
|
|
rstN => rstN(i),
|
| 49 |
|
|
cpu_cs1 => cpu_cs1(i),
|
| 50 |
|
|
cpu_cs2 => cpu_cs2(i),
|
| 51 |
|
|
cpu_cs3 => cpu_cs3(i),
|
| 52 |
|
|
cpu_we => cpu_we(i),
|
| 53 |
|
|
cpu_a => cpu_a(i * 5 + 4 downto i * 5),
|
| 54 |
|
|
cpu_d => cpu_d(i * 8 + 7 downto i * 8),
|
| 55 |
|
|
cpu_irq4 => cpu_irq4(i),
|
| 56 |
|
|
cpu_irq7 => cpu_irq7(i)
|
| 57 |
|
|
);
|
| 58 |
|
|
end generate gen_blocks;
|
| 59 |
|
|
end;
|
© copyright 1999-2026
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.