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 

sheduling.......

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



Joined: 12 Feb 2009
Posts: 8

PostPosted: Mon Apr 20, 2009 12:22 pm    Post subject: sheduling....... Reply with quote

package Mult0;

// Simple (naive) binary multiplier

typedef Bit#(16) Tin;
typedef Bit#(32) Tout;

(* synthesize *)
module mkMult0();
Tin d = 9, r = 5;

Reg#(Tout) product <- mkReg(0);
Reg#(Tout) mcand <- mkReg({0, d});
Reg#(Tin) mplr <- mkReg(r);

rule cycle ( mplr != 0 );
if (mplr[0] == 1) product <= product + mcand;
mcand <= mcand << 1;
mplr <= mplr >> 1;
endrule

rule done ( mplr == 0 );
$display ("Product = %d", product);
$finish(0);
endrule

endmodule: mkMult0

endpackage: Mult0

[/b]now how to do i use value stored in product in my next module.....
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