Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
15472 Discussions

Academic Q: Why doesn't Quartus Synthesis Allow Some Restricted Classes?

Altera_Forum
Honored Contributor II
934 Views

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
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
105 Views

I don't think classes are supported for syntheses at all.

Altera_Forum
Honored Contributor II
105 Views

Static class methods are synthesizable in other tools, but apparently not in the tool you are using. They allow you to have parameterizable functions.

Altera_Forum
Honored Contributor II
105 Views

Thanks Tricky, dave_59. 

 

Yep, the tool is Quartus. 

 

Thanks again, Tom
Reply