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.

SystemVerilog connecting a channel

Status
Not open for further replies.

quarryman

Newbie level 2
Newbie level 2
Joined
Apr 28, 2014
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
16
I'm trying to hook up a new channel (channel 2) to an existing one (channel1) like so:

Code:
channel channel1;
channel channel2;

extern function new(
channel channel2
);

function subenv1::new(
channel channel2
);

this.channel1 = new();

xactor1(
this.channel1
);

xactor2(
this.channel1
);

//channel1 is a connection between both xactors

//hook new channel2 up to channel1
[B]channel2 = this.channel1[/B]

This seems to work fine at this level, ie if I do this check, it doesn't cause a fatal. I have no compile errors.
if (channel2 ==null) `cvm_fatal


However when I go up to the subenv above this
if (channel2 ==null) `cvm_fatal

Then I get a fatal at run-time. What else do I need to ensure that the channel is not fatal at the next level up?
 
Last edited by a moderator:

You did not show your code fragments very well, but I'm assuming you want the constructors argument to be an output. By default it is an input.
 

You did not show your code fragments very well, but I'm assuming you want the constructors argument to be an output. By default it is an input.

Thanks for that dave. Yes I might have over simplified the actual code. But I wanted to make it clear.

So arguments are defaulted to inputs eh?

I think this channel needs to be an input though as I'm trying to send transactions in with channel1. Are channels not usually bidirectional - does the concept of input and output apply?
 

From the SystemVerilog point of view, a channel is just a class type, and passing around a handle to an object of that class type is different than moving data around using that object. The TLM concepts from SystemC and UVM clearly make the distinction between connecting ports objects (what you are calling a channel) and the data flow through the port using methods of that object (the put/get or send/receive methods).

Without seeing a more complete example, it's going to be difficult to explain further what is happening in your situation.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top