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 · 10 comments
Open

Support primitive instantiations #468

veripoolbot opened this issue Mar 23, 2012 · 10 comments
Labels
effort: weeks Expect this issue to require weeks or more of invested effort to resolve type: feature-IEEE Request to add new feature, described in IEEE 1800

Comments

@veripoolbot
Copy link
Contributor


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
Copy link
Contributor Author


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
Copy link
Contributor Author


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
Copy link
Contributor Author


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.

@veripoolbot veripoolbot added effort: weeks Expect this issue to require weeks or more of invested effort to resolve type: feature-IEEE Request to add new feature, described in IEEE 1800 labels Dec 22, 2019
@hughperkins
Copy link

could you point me at the code you started to write please?

@wsnyder
Copy link
Member

wsnyder commented Apr 3, 2022

Attached. I just updated this to at least not have conflicts against the current git master, but didn't check if it compiled etc
bug468_udp.patch.txt
.

@hughperkins
Copy link

thanks!

@hughperkins
Copy link

hughperkins commented Apr 3, 2022

For the name, presumably can just generate a likely-unique name like [name of file]-line[line number]?

(Edit: this doesnt mean I'm working on this btw, just vaguely pondering this)

@hughperkins
Copy link

(well... at the time of usage. not at the time of declaration. but that's how module names work anyway I think?).

@svenka3
Copy link
Contributor

svenka3 commented Apr 11, 2023

Attached. I just updated this to at least not have conflicts against the current git master, but didn't check if it compiled etc bug468_udp.patch.txt .

Am attempting to look at this one - I see single file V3LinkResolve.cpp - is that all to it or is it the just the first step? Also, I see bulk/all of ComboUDP work is done in this patch.txt, would that be a start to see if it works? What is not very clear to me is "where is the actual look-up happening" (UDP --> a LookUpTable).

Thanks

@wsnyder
Copy link
Member

wsnyder commented Apr 11, 2023

The approach can likely all be done there, it converts the UDP to "normal" behavioral primitives. It won't work as is, you need to read the code and understand how to finish it off, sequential UDPs being probably the biggest missing piece.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: weeks Expect this issue to require weeks or more of invested effort to resolve type: feature-IEEE Request to add new feature, described in IEEE 1800
Projects
None yet
Development

No branches or pull requests

4 participants