bluespec.com Forum Index bluespec.com
Bluespec Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

High impedance TriState Element

 
Post new topic   Reply to topic    bluespec.com Forum Index -> Designing with BSV's Rules, Interfaces, ...
View previous topic :: View next topic  
Author Message
jtsjunior



Joined: 02 Jan 2014
Posts: 7

PostPosted: Wed Nov 29, 2017 10:15 am    Post subject: High impedance TriState Element Reply with quote

Hi all,
there is a way to test a high impedance state of a TriState interface, just like the ZBus interface does with it fromBusValid method?
That's because I have a TriState logic solution, but all signals which depends on it has an unknown state on simulation with iverilog, like the piece of code below.

Code:

   Direction direction;
   if (txfunneled.notEmpty) direction = MasterToSlave;
   else if (!txfunneled.notEmpty && isValid(zbuf)) direction = SlaveToMaster;
   else direction = Idle;


Where the variable zbuf is a TriState interface of a Maybe. The waveform generated on simulation shows that the "direction" signal is always unknown when txfunneled is empty.
Back to top
View user's profile Send private message
quark
Site Admin


Joined: 02 Nov 2007
Posts: 494

PostPosted: Tue Dec 05, 2017 5:35 pm    Post subject: Re: High impedance TriState Element Reply with quote

The "mkTriState" module is an imported Verilog module in the file "TriState.v", and that module does not appear to provide a valid signal, only the value.

I agree that it would be worthwhile if the interface provided a Maybe value, or at least provided a valid signal along with the value.

You can implement yourself by copying the TriState.v file and changing the module to export a valid signal (or a Maybe-encoded value), and then writing your own import-BVI statement to import the Verilog module into BSV.
Back to top
View user's profile Send private message
jtsjunior



Joined: 02 Jan 2014
Posts: 7

PostPosted: Fri Dec 08, 2017 1:23 pm    Post subject: Reply with quote

thanks for the tip, quark.
I'll try to do that.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    bluespec.com Forum Index -> Designing with BSV's Rules, Interfaces, ... All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
bluespec.com topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP