A
Analog_Guy
Guest
I am trying to implement a transaction based client/server testbench
using records, but am having difficulty getting to the bottom of my
compilation errors regarding my transaction records (which contain an
enumerated type).
******Signal 'cpu_cmd' has multiple drivers but is not a resolved
signal.
I am trying to base the testbench on the approaches taken by Janick
Bergeron (code snippets), Jim Lewis (records of INOUT with only
STD_LOGIC) and Ben Cohen (records of either IN or OUT with various
element types). Each presents a slightly different case, but I am
trying to come to my own understanding of the testbench structure.
I am wanting to use records of INOUT with all STD_LOGIC elements,
except for one element which is an enumerated type.
In a CPU BFM package, I have defined the following:
TYPE CPU_INSTR_TYPE IS (CPU_READ, CPU_WRITE);
--
TYPE CPU_CMD_TYPE IS RECORD
instr : CPU_INSTR_TYPE;
addr : STD_LOGIC_VECTOR(0 TO 15);
data : STD_LOGIC_VECTOR(0 TO 15);
END RECORD CPU_CMD_TYPE;
--
SIGNAL cpu_cmd : CPU_CMD_TYPE;
Essentially, this record communicates between a test control entity and
a CPU BFM, and is defined as INOUT at the top-level (i.e. for both of
the modules described). With the above method, the code compiles, but
when I load the testbench in ModelSim I receive the "multiple drivers"
error.
I have tried eliminating the global signal declaration that appears
above, and defining cpu_cmd at the top-level, but that doesn't make
much of a difference. Instead, I get the same error during
compilation.
I am assuming the fact that CPU_INSTR_TYPE is unresolved and the
records are INOUT is leading to the 'multiple drivers' error.
Are there any suggestions to get to the bottom of this issue? Do I
have to separate the 'instr' element into a separate record (doesn't
seem to be as clean)? If I want mixed elements in a record am I going
to have to separate the record elements into an IN record and an OUT
record?
using records, but am having difficulty getting to the bottom of my
compilation errors regarding my transaction records (which contain an
enumerated type).
******Signal 'cpu_cmd' has multiple drivers but is not a resolved
signal.
I am trying to base the testbench on the approaches taken by Janick
Bergeron (code snippets), Jim Lewis (records of INOUT with only
STD_LOGIC) and Ben Cohen (records of either IN or OUT with various
element types). Each presents a slightly different case, but I am
trying to come to my own understanding of the testbench structure.
I am wanting to use records of INOUT with all STD_LOGIC elements,
except for one element which is an enumerated type.
In a CPU BFM package, I have defined the following:
TYPE CPU_INSTR_TYPE IS (CPU_READ, CPU_WRITE);
--
TYPE CPU_CMD_TYPE IS RECORD
instr : CPU_INSTR_TYPE;
addr : STD_LOGIC_VECTOR(0 TO 15);
data : STD_LOGIC_VECTOR(0 TO 15);
END RECORD CPU_CMD_TYPE;
--
SIGNAL cpu_cmd : CPU_CMD_TYPE;
Essentially, this record communicates between a test control entity and
a CPU BFM, and is defined as INOUT at the top-level (i.e. for both of
the modules described). With the above method, the code compiles, but
when I load the testbench in ModelSim I receive the "multiple drivers"
error.
I have tried eliminating the global signal declaration that appears
above, and defining cpu_cmd at the top-level, but that doesn't make
much of a difference. Instead, I get the same error during
compilation.
I am assuming the fact that CPU_INSTR_TYPE is unresolved and the
records are INOUT is leading to the 'multiple drivers' error.
Are there any suggestions to get to the bottom of this issue? Do I
have to separate the 'instr' element into a separate record (doesn't
seem to be as clean)? If I want mixed elements in a record am I going
to have to separate the record elements into an IN record and an OUT
record?