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.

modelsim SE 6.4 having problem with mailbox in system verilog.

Status
Not open for further replies.

bntpathak

Newbie level 1
Newbie level 1
Joined
May 22, 2013
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,290
we are creating a driver, transactor, generator, program, interface, DUT file and a top. In top file when load all given files then this type of error produce.
# Loading work.test
# ** Error: (vsim-3978) generator.sv(16): Cannot assign an unpacked type to a packed type.
# Time: 0 ns Iteration: 0 Region: /top/tst File: E:/lab2 sram/program.sv
# Error loading design



code of generator
typedef class packet;
class generator;
packet pkt;
// parameter type T = bit;
mailbox mbx;

function new(mailbox mbx);
this.mbx = mbx;//(100);
endfunction


task run(int count);
repeat (count) begin
pkt = new();
void'(pkt.randomize);
mbx.put(pkt);
end
endtask

endclass

please help me to ignore this error.
 

Early versions of modelsim do not support untyped mailboxes.

My recommendation is to always use typed mailboxes anyways - it is safer.


class generator;
packet pkt;
// parameter type T = bit;
mailbox #(packet) mbx;

function new(mailbox#(packet) mbx);
this.mbx = mbx;//(100);
endfunction


task run(int count);
repeat (count) begin
pkt = new();
void'(pkt.randomize);
mbx.put(pkt);
end
endtask

endclass
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top