Implementierung von ROM in xilinx ( vhdl )

Ich versuche zu implementieren ist ein rom-Modul und baute einen Prüfstand für es . Die syntax prüfen für rom.vhd zeigt die "richtige" und es zeigt auch, die "richtige" test bench-Datei auch , aber wenn ich auf simluate es zeigt einige Fehler.

Folgende code ist der code und die Fehlermeldung, die angezeigt wird .

LIBRARY ieee ;
USE ieee.std_logic_1164.all ;
----------------

entity rom is 
port ( clk : in std_logic ;
     address : in integer range 0 to 15 ;
     data_out : out std_logic_vector( 7 downto 0 )) ;
end entity ;

------------------
architecture arch of rom is 

signal reg_address : integer range 0 to 15 ;
type memory is array ( 0 to 15 ) of std_logic_vector( 7 downto 0 ) ;
constant myrom : memory := (
2 => "11111111" , --255
3 => "11010101" , 
4 => "01101000" , 
6 => "10011011" , 
8 => "01101101" , 
9 => "00110111" , 
others => "00000000" ) ;
begin 
process(clk)
begin 
if( clk'event and clk = '1' ) then
    reg_address <= address ;
end if ;
end process ;
---------------
data_out <= myrom(reg_address) ;
 end architecture ;

testbench-Datei :

LIBRARY ieee ;
USE ieee.std_logic_1164.all ;
----------------

entity rom_tb is 
end entity ;

-----------------------
architecture tb of rom_tb is 
component rom is 
port ( clk : in std_logic ;
     address : in integer range 0 to 15 ;
     data_out : out std_logic_vector( 7 downto 0 )) ;
end component ;
--------------------------
signal clk_tb : std_logic := '0' ;
signal address_tb : integer := 0 ; 
signal data_out_tb : std_logic_vector( 7 downto 0 ) ;
--------------------------
begin 
dut : rom port map (
    clk => clk_tb ,
    address => address_tb ,
    data_out => data_out_tb ) ;
------------------
clk_tb <= not clk_tb after 20ns ;
address_tb <= 1 after 30ns ,
                 2 after 60ns ,
                 3 after 90ns ,
                  4 after 120ns ,
                 5 after 150ns ,
                 6 after 180ns ,
                 7 after 210ns ,
                 8 after 240ns ,
                 9 after 270ns ,
                10 after 300ns ,
                11 after 330ns ,
                12 after 360ns ,
                13 after 390ns ,
                14 after 420ns ,
                15 after 450ns ;
 end architecture ; 

Fehler :

ERROR:Simulator:29 - bei 0 ns : in rom_tb(tb), Datei
D:/VHDLPrograms/Tb/ROM/rom_tb.vhd: Standard-port-Karte für entity-rom
Komponenten-rom verbindet INTEGER-Typ local port-Adresse der Komponente, die
std_logic_vector port der Einheit.

Ich baute den code, den man in einer neuen Xilinx-Projekt mit ISE 14.4 und ISim, und ich kann nicht reproduzieren Sie Ihr problem.
Bedeutet, es ist Arbeit . sind Sie immer der Ausgang.
i.stack.imgur.com/Q7MhE.png
Okay ! Die Verhaltens-simulation ausgeführt wird, aber der post-route simulation nicht funktioniert .
Getestet habe ich dein tb auf modelsim 10.2 und es funktioniert Prima. Allerdings bekam ich die folgende Warnung : 'Warnung: [4] rom_tb.vhd(26): (vcom-1207) Eine abstrakte Literale und Bezeichner muss eine Trennlinie zwischen Ihnen.'.

InformationsquelleAutor AbKDs | 2013-07-10

Schreibe einen Kommentar