Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help needed with a generic based signal error

Status
Not open for further replies.

Avysochin

Newbie
Joined
Jan 19, 2022
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
10
Hello dear
there are many examples of such use
Rich (BB code):
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity testbench is
Generic (   
        Nkeybus : positive := 8);            -- input bus width
end testbench;

architecture tb of testbench is

signal key_i : in std_logic_vector (Nkeybus-1 downto 0) := (others => 'X');
signal key_o : out std_logic_vector (Nkeybus-1 downto 0);

but i have the errors:

COMP96 ERROR COMP96_0018: "Identifier expected." "testbench.vhd" 12 16
COMP96 ERROR COMP96_0018: "Identifier expected." "testbench.vhd" 13 16


could you advice me
 

Hello dear
there are many examples of such use
Rich (BB code):
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity testbench is
Generic ( 
        Nkeybus : positive := 8);            -- input bus width
end testbench;

architecture tb of testbench is

signal key_i : in std_logic_vector (Nkeybus-1 downto 0) := (others => 'X');
signal key_o : out std_logic_vector (Nkeybus-1 downto 0);

but i have the errors:

COMP96 ERROR COMP96_0018: "Identifier expected." "testbench.vhd" 12 16
COMP96 ERROR COMP96_0018: "Identifier expected." "testbench.vhd" 13 16


could you advice me
you should remove that generic from testbench interface but set bitwidth inside the architecture as you like
 

@kaz1 why? Its not unusual to want to run a test using different bitwidths. This can only come via a constant in the architecture or generic on the TB. Using a generic means you can simply re-run it multiple times with the generic supplied by the running script.

@Avysochin simply remove "in" and "out" from the signal declarations. These are simply wires in the tesbench and hence have no direction. A signal cannot be given a direction.
 

@kaz1 why? Its not unusual to want to run a test using different bitwidths. This can only come via a constant in the architecture or generic on the TB. Using a generic means you can simply re-run it multiple times with the generic supplied by the running script.

@Avysochin simply remove "in" and "out" from the signal declarations. These are simply wires in the tesbench and hence have no direction. A signal cannot be given a direction.
yes certainly I missed to read that in/out at signal declaration. I also assumed a standard testbench interface for a beginner would not put generic up there. Going to scripting with default generic on testbench is something I never seen the need for it and it seems too advanced for such setup.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top