No array recognition
See original GitHub issueI’m using Icarus verilog 0.9.7 on Ubuntu, and I can’t access or view a multiple dimension array. Here is an adder modified example.
// Adder DUT
module adder #(
parameter DATA_WIDTH = 4
) (
input [DATA_WIDTH-1:0] A,
input [DATA_WIDTH-1:0] B,
output reg [DATA_WIDTH:0] X
);
reg [DATA_WIDTH-1:0] J [1:0];
always @(A or B) begin
X <= A + B;
J[1] <= A; J[0] <= B;
end
endmodule
# Simple tests for an adder module
import cocotb
from cocotb.triggers import Timer
@cocotb.test()
def adder_basic_test(dut):
"""Test for 5 + 10"""
yield Timer(2)
dut.A = 5
dut.B = 2
yield Timer(2)
#cocotb.log.info(dut.J[0])
dut.J[0] = 2;
#print (dut.J)
#any of these 3 intructions fails
and I get the following error:
Send raised exception: adder contains no object named J File “/cocotb/decorators.py", line 212, in send return self._coro.send(value) File "/examples/adder/tests/test_adder.py”, line 14, in adder_basic_test dut.J[0] = 2; File “***/cocotb/handle.py”, line 289, in getattr raise AttributeError(“%s contains no object named %s” % (self._name, name))
5000000000.00ns ERROR cocotb.regression regression.py:286 in handle_result Test Failed: adder_basic_test (result was TestError) 5000000000.00ns ERROR cocotb.regression regression.py:196 in tear_down Failed 1 out of 1 tests (0 skipped)
Any help would be appreciated
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top GitHub Comments
I seem to remember this being and issue with Icarus, can you try the latest master or Icarus?
That output above it from cocotb. Support for different types is dependent on the simulator, the open sources ones do not provide as much coverage as the aid for ones unfortunately. I’m inclined to close this as I don’t believe at the moment the issue is related to cocotb. If you try this on modelsim (also free, well at one time) and see the same issue then please re-open.