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 

Clock clk2x vs typedef struct { Clock clk2x } ClockStruct; ?

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



Joined: 01 Nov 2007
Posts: 1
Location: University of Texas at Austin

PostPosted: Mon Sep 22, 2008 3:38 pm    Post subject: Clock clk2x vs typedef struct { Clock clk2x } ClockStruct; ? Reply with quote

I'm trying to pass in a separate clock to one of my modules. I can do this just fine using the following syntax:

Code:
(* synthesize *)
module mkTest (Clock clk2x, Test ifc);
...


I'm anticipating that in the future, we might need to pass around more than just one extra clock to some of our modules. In an effort to avoid changing interfaces all over the place (since it is already pretty inconvenient to pass extra clocks in the first place - maybe there could be a mechanism added for registering clocks for global usage?), I thought it would be nice to pass the clock in as part of a struct. This would allow me to put an additional Clock in the struct at any time, while preserving the original interface to all modules.

However, the bluespec compiler doesn't seem to like this construct. This is what I'm doing:

Code:
typedef struct {
 Clock clk2x;
} ClockStruct;

(* synthesize *)
module mkTest (ClockStruct clockStruct, Test ifc);
...


The compiler gives me this error:

Code:
Error: "Test.bsv", line 14, column 8: (T0043)
  Cannot synthesize `mkTest': A parameter of the module uses the type
  `Test::ClockStruct' which is not in the Bits class.


I've tried making the ClockStruct derive Bits, to no avail:

Code:
typedef struct {
 Clock clk2x;
} ClockStruct deriving (Bits);


I still get the same compiler error. This seems like it should work without any problems. Any ideas? Would it be possible to get this functionality (or some other form of increased flexibility when dealing with clocks) in a future bluespec release?

Thanks.

Code:
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