Comments (4)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
The "syntax" is a horrible hack that was superceded by the
much cleaner (* ... *) syntax for attributes, but it is still
used a lot, so I do try to support it. So no, there is not
really any consistent documentation for the syntax.
It looks like what you are doing should work, though, so I'll
take a look and try to see what's up.
On 08/08/2014 06:23 AM, Clifford Wolf wrote:
The following module
|module test(output reg [7:0] y); initial begin // synthesis
translate_off y <= 42; // synthesis translate_on end endmodule |results in the following syntax error (iverilog git 0f294cb
0f294cb):|test.v:3: syntax error test.v:3: Syntax in assignment statement
l-value. test.v:4: syntax error |I'm not sure if there is any kind of formal definition for the
|synthesis translate_off| / |synthesis translate_on| comments, but
the lattice lm32 CPU
https://github.com/m-labs/lm32/blob/master/rtl/lm32_load_store_unit.vis using them inside behavioral code like in my example.
— Reply to this email directly or view it on GitHub
#36.
Steve Williams "The woods are lovely, dark and deep.
steve at icarus.com But I have promises to keep,
http://www.icarus.com and lines to code before I sleep,
http://www.picturel.com And lines to code before I sleep."
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iEYEARECAAYFAlPk3lcACgkQrPt1Sc2b3ik2OgCeJTp0NEwJOOyM1zfobHUMw1vY
maYAoJbDiJrQPD2KgBHobD9GCt8geIG8
=P+4H
-----END PGP SIGNATURE-----
from iverilog.
In Yosys they are handled in the lexer as a special form of comment block. Recently I found this in some user code:
//synopsys translate_off
`include "timescale_x.v"
//synopsys translate_on
Because in yosys the `include is interpreted by the pre processor (which is run before the lexer of course), it is executed in yosys. I'm not sure what "the right thing to do" is in this cases like this (and many others that I could come up with, but this one I actually found). Any suggestions?
Funny detail: There is no "timescale_x.v". So the yosys pre-processor created an `error for that. But this was ignored because the lexer was skipping the "translate_off" block. I only noticed this piece of code because a bug in the pre-processor caused an off-by-one error in a line number for an error later in that file.
from iverilog.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
In Icarus Verilog they are handled in the lexor, but they mark
a flag instead of actually turning translation off. What is between
the off/on is still parsed and elaborated, but it is all marked
with an (* ivl_synthesis_off *) attribute to prevent synthesis.
On 08/08/2014 06:22 PM, Clifford Wolf wrote:
In Yosys they are handled in the lexer as a special form of
comment block. Recently I found this in some user code:|//synopsys translate_off `include "timescale_x.v" //synopsys
translate_on |Because in yosys the `include is interpreted by the pre processor
(which is run before the lexer of course), it is executed in yosys.
I'm not sure what "the right thing to do" is in this cases like
this (and many others that I could come up with, but this one I
actually found). Any suggestions?Funny detail: There is no "timescale_x.v". So the yosys
pre-processor created an `error for that. But this was ignored
because the lexer was skipping the "translate_off" block. I only
noticed this piece of code because a bug in the pre-processor
caused an off-by-one error in a line number for an error later in
that file.— Reply to this email directly or view it on GitHub
#36 (comment).
Steve Williams "The woods are lovely, dark and deep.
steve at icarus.com But I have promises to keep,
http://www.icarus.com and lines to code before I sleep,
http://www.picturel.com And lines to code before I sleep."
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iEYEARECAAYFAlPmMTYACgkQrPt1Sc2b3ikAegCfTh9Tr2pvRsmYP5UM5gj9D1eE
5+sAnj1WuJnv3/BiOg9gw1wW0hdqkCcR
=y7EH
-----END PGP SIGNATURE-----
from iverilog.
Should be fixed in git master, now. I've fixed it to be handled in the lexor, instead of in the parser, which in retrospect was a bad idea.
from iverilog.
Related Issues (20)
- Uninformative "syntax error" message when an undefined package name is used HOT 4
- No error or warning reported when a vector lsb or msb value contains `x` or `z` bits HOT 7
- function being classified as non-constant HOT 3
- no warning for scaler being access with indexed part select. No warning for double assignment of combiniational logic HOT 2
- incomplete for statement produces no output. HOT 9
- $display not working inside function during non clocked execution HOT 2
- icarus gets caught in a infinite combi loop and I'm not sure why. HOT 4
- infinant loop in recursive function causes crash HOT 2
- Assertion Failure in AST Processing: node->bits == v at frontends/ast/ast.cc:855 HOT 1
- Simulation results discrepancy HOT 1
- Unpacked localparam array support
- Simulation mismatches in RTL vs post synthesis netlist(Yosys generated) co_simulation HOT 2
- During simulation, iverilog incorrectly assigned a value to a variable that was not driven. HOT 7
- iverilog err cannot found CXX_ABI_1.3.8 HOT 1
- Save and Restore simulation state HOT 2
- Trying to use IVerilog throws "The system cannot find the path specified" error on Windows HOT 1
- Compiler fails to initialize array value for vvp HOT 6
- During simulation, iverilog mistakenly assigned a value to an undriven variable. HOT 2
- vvp hangs forever on msys2 but does not on linux HOT 13
- VPI: callback function scheduling itself
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iverilog.