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 

Partially applied type synonym `Tuple3'

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



Joined: 13 Jan 2014
Posts: 4

PostPosted: Fri Feb 01, 2019 4:53 am    Post subject: Partially applied type synonym `Tuple3' Reply with quote

When we run the code with Tuple3, it gives error as:
line 52, column 33: (T0013)
Partially applied type synonym `Tuple3'

The line 52 is the first line of below BSV code:

module mkAXI4_Fabric #(function Tuple3 #(Bool, Bit #(TLog #(num_slaves) , Bit #(TLog #(ids)))) fn_addr_to_slave_num (Bit #(wd_addr) addr , Bit #(wd_id) id)) (AXI4_Fabric_IFC #(num_masters, num_slaves,ids , wd_addr,wd_id, wd_data, wd_user))


provisos (Log #(num_masters, log_nm),
Log #(num_slaves, log_ns),
Log #(id, log_id),
Log #(TAdd #(num_masters, 1), log_nm_plus_1),
Log #(TAdd #(num_slaves, 1), log_ns_plus_1),
Log #(TAdd #(id, 1), log_id_plus_1),
Add #(_dummy, TLog #(num_slaves) ,log_ns_plus_1));
Embarassed [b]

Second time the Tuple3 is used in below BSV code:
function Tuple3#(Bool, Bit #(Bits_per_Slave_Num) , Bit #(Bits_per_IDs) ) fn_addr_to_slave_num (Bit #(Wd_Addr) addr , Bit #(Wd_Id)id);
Bool legal = True;
Bit #(Bits_per_Slave_Num) slave_num = fromInteger (valueOf (Num_Slaves));
Bit #(Bits_per_IDs) id_num = fromInteger (valueOf (IDs));

if((addr >= 'h0000_0000_0000_0000 && addr <= 'h0000_0000_0000_FFFF) && id == 'h01) /// 64KB BRAM Memory
slave_num = 0;
else if((addr >= 'h0000_0000_0002_0000 && addr <= 'h0000_0000_0003_FFFF) && id == 'h02) /// 128KB BRAM memory //

slave_num = 1;
Back to top
View user's profile Send private message
quark
Site Admin


Joined: 02 Nov 2007
Posts: 496

PostPosted: Fri Feb 01, 2019 1:17 pm    Post subject: Reply with quote

Your parentheses are not right in this type on that line:
Code:
Tuple3 #(Bool, Bit #(TLog #(num_slaves) , Bit #(TLog #(ids))))

It should be:
Code:
Tuple3 #(Bool, Bit #(TLog #(num_slaves)), Bit #(TLog #(ids)))


BSC could have been more helpful if it first reported that "Bit" was being applied to two arguments (since a close-paren was missing after the type), rather than first reporting that "Tuple" was applied to too few arguments (because the third argument was accidentally grouped inside the second argument).
Back to top
View user's profile Send private message
gurmohan



Joined: 13 Jan 2014
Posts: 4

PostPosted: Mon Feb 04, 2019 1:42 am    Post subject: Partially applied type synonym `Tuple3' Reply with quote

quark wrote:
Your parentheses are not right in this type on that line:
Code:
Tuple3 #(Bool, Bit #(TLog #(num_slaves) , Bit #(TLog #(ids))))

It should be:
Code:
Tuple3 #(Bool, Bit #(TLog #(num_slaves)), Bit #(TLog #(ids)))


BSC could have been more helpful if it first reported that "Bit" was being applied to two arguments (since a close-paren was missing after the type), rather than first reporting that "Tuple" was applied to too few arguments (because the third argument was accidentally grouped inside the second argument).



Thank you , the problem got resolved.
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