- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Was pleased to discover SV supports scalable tasks/functions to the extent that if you bury it in a class you can set the 'type' by parameter.
Why then can't this be synthesized? For example, why can't I synthesize this: class generic# (type T=logic);
static function int find_first_msb(input T vector);
for(int i=$bits(vector)-1;i>=0;i--)
if(vector)
return i;
return -1;
endfunction//find_first_msb
endclass
...
msb = generic#(uint32)::find_first_msb(decimal);
Rather, I have to create a fixed-width version. function int find_first_msb(input uint32 vector);
for(int i=$bits(vector)-1;i>=0;i--)
if(vector)
return i;
return -1;
endfunction//find_first_msb
There's nothing to prevent this limited (but useful!) functionality from being synthesized. ~SysTom
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't think classes are supported for syntheses at all.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Static class methods are synthesizable in other tools, but apparently not in the tool you are using. They allow you to have parameterizable functions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Tricky, dave_59.
Yep, the tool is Quartus. Thanks again, Tom
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page