Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support primitive instantiations #468

Open
veripoolbot opened this issue Mar 23, 2012 · 3 comments
Open

Support primitive instantiations #468

veripoolbot opened this issue Mar 23, 2012 · 3 comments

Comments

@veripoolbot
Copy link

@veripoolbot veripoolbot commented Mar 23, 2012


Author Name: Alex Solomatnikov
Original Redmine Issue: 468 from https://www.veripool.org
Original Date: 2012-03-23


Primitive definition:

primitive PRIM_DFFE (Q, ENA, D, CLK, CLRN, PRN, notifier);
    input D;   
    input CLRN;
    input PRN;
    input CLK;
    input ENA;
    input notifier;
    output Q; reg Q;
...

Primitive instantiation:

module dffe ( Q, CLK, ENA, D, CLRN, PRN );
    input D;
    input CLK;
    input CLRN;
    input PRN;
    input ENA;
    output Q;
    
    wire D_ipd;
    wire ENA_ipd;
    wire CLK_ipd;
    wire PRN_ipd;
    wire CLRN_ipd;
    
    buf (D_ipd, D);
    buf (ENA_ipd, ENA);
    buf (CLK_ipd, CLK);
    buf (PRN_ipd, PRN);
    buf (CLRN_ipd, CLRN);
    
    wire   legal;
    reg 	  viol_notifier;
    
    PRIM_DFFE ( Q, ENA_ipd, D_ipd, CLK_ipd, CLRN_ipd, PRN_ipd, viol_notifier );
...

error:

syntax error, unexpected '(', expecting IDENTIFIER

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Mar 23, 2012


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2012-03-23T02:20:10Z


Primitives are not synthesizable and are very slow compared to writing good behavioral code and so are unlikely to be supported in the near term.

However if you want to undertake this, there is a bit of code I started on to support them a while ago before I decided it was too nasty for performance.

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Apr 24, 2012


Original Redmine Comment
Author Name: Alex Solomatnikov
Original Date: 2012-04-24T18:09:29Z


BTW, the problem with the code above is that verilator can not parse anonymous primitive instantiation.

If instance name is added, then at least verilator does not complain during parsing.

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Apr 25, 2012


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2012-04-25T00:43:21Z


Added disabled test t_udp_noname. Anonymous UDPs will be a pain to support as removing the name results in a parser conflict, requiring a cascade of changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.