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 

Problem when using predefined structs inside tagged union

 
Post new topic   Reply to topic    bluespec.com Forum Index -> Tools: BSC (Bluespec Compiler)
View previous topic :: View next topic  
Author Message
gururaj



Joined: 31 Oct 2012
Posts: 19

PostPosted: Thu Nov 01, 2012 10:13 am    Post subject: Problem when using predefined structs inside tagged union Reply with quote

Hi,
I have my tagged union defined as follows:
typedef union tagged {
void Ok;
void Error;
struct{DataAddress src;RegNum rd;WarpID warpID;} LoadRequest;
} InstructionReturn
deriving(Bits,Eq);

This works fine. However when I have a struct LoadRequestAssert defined in the following manner ,

typedef struct {
DataAddress src;
RegNum rd;
WarpID warpID;
} LoadRequestAssert deriving (Bits,Eq);

and I replace
struct{DataAddress src;RegNum rd;WarpID warpID;} LoadRequest;
in the tagged union by
LoadRequestAssert LoadRequest;
it gives me an error :
Error: "SimpleProcessor.bsv", line 163, column 37: (T0007)
Unbound type constructor `SimpleProcessor.InstructionReturn_$LoadRequest'

Is this a bug? or am I expecting something wrong?
Regards,
Gururaj
Back to top
View user's profile Send private message
quark
Site Admin


Joined: 02 Nov 2007
Posts: 495

PostPosted: Fri Nov 02, 2012 1:29 pm    Post subject: Re: Problem when using predefined structs inside tagged unio Reply with quote

What you have written here is correct. There must be something elsewhere in your file that is triggering this problem. Perhaps a pattern match or struct value -- what is the error pointing to at line 163? Can you show us more of the file?
Back to top
View user's profile Send private message
gururaj



Joined: 31 Oct 2012
Posts: 19

PostPosted: Sat Nov 10, 2012 2:51 pm    Post subject: Reply with quote

Thanks for your reply quark! Your reply made me think and find out my mistake.

I was trying to initialise the tagged union LoadRequest instead of initialising the struct LoadRequestAssert first.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    bluespec.com Forum Index -> Tools: BSC (Bluespec Compiler) 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