String Signal Declaration

A

Analog_Guy

Guest
I am trying to declare a SIGNAL of type STRING in a testbench package.
The signal is strictly used to contain information for a header that I
want to WRITE from within the testbench.

I want to FORCE the value of the signal with a ModelSim DO file, so
that I don't have to re-compile the package each time I need a
different header (i.e. Date, Device, Simulation Type, etc.).

Previously, I just used a CONSTANT declaration, and all was fine
(except that I have to re-compile the package each time I change the
CONSTANT value for successive runs).

How come I can do the following:
CONSTANT SIM_TYPE : STRING := "Behavioral";

But not the following:
SIGNAL SIM_TYPE : STRING := "Behavioral";

ModelSim complains of an array type that is unconstrained.

How can I make the SIGNAL declaration generic, so that I don't have to
manually set the RANGE each time? I just want to feed in various
length STRINGs from my DO file.
 
Analog_Guy wrote:

But not the following:
SIGNAL SIM_TYPE : STRING := "Behavioral";
variables and signals are fixed size.

SIGNAL my_sig: STRING(1 to 10) := "Behavioral";

or use a subtype:

subtype sim_type is STRING(1 to 10) ;
signal my_sig : sim_type := "my_sig ";
signal your_sig : sim_type := "Behavioral";

-- Mike Treseler
 

Welcome to EDABoard.com

Sponsor

Back
Top