Re: [myhdl-list] Need instance name
Brought to you by:
jandecaluwe
From: Jan D. <ja...@ja...> - 2009-04-19 05:58:48
|
Neal Becker wrote: > I coded a function that, when synthesized, generates very poor verilog code. > So, I hand coded the verilog using __verilog__. Problem is, that I coded > something like: > > always @(%(x)s) begin > reg signed [%(inbits)s-1:0] y1; > ... > > This gives a syntax error regarding unnamed blocks. If I let myhdl code the > block, it would be a named block, using the instance name. > > How can I get the instance name from my python code, so I could write > > always @(%(x)s) begin: <instance name> The hierarchical name generated by MyHDL is internal, but surely you don't need that one. Just put a name there in the __verilog__ template. If parameterization is needed, you can use any name from the surrounding namespace in the template. I suspect something else is going on though. I don't think named blocks are used systematically by Verilog designers. Jan -- Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com Python as a HDL: http://www.myhdl.org VHDL development, the modern way: http://www.sigasi.com Analog design automation: http://www.mephisto-da.com World-class digital design: http://www.easics.com |