GithubHelp home page GithubHelp logo

Comments (1)

stefanpie avatar stefanpie commented on May 27, 2024

I wanted to follow up on this pull request after some more experimenting:

  1. There are other small Verilog syntax edge cases not supported by Odin that are defined in the Verilog 1995 standard.
  2. I made a Verilog "preprocessing" Python module as a quick workaround that works for now.

Other Verilog Edge Cases
Odin II does not support spaces in integer literals. For example, the following integer literals will cause errors in Odin II.

32'h 0000_0000,
32'h ffff_ffff,
32'h 0000_0010,

However, if you remove the space from the integer literals, as shown below, Odin II can parse the Verilog without throwing those specific errors.

32'h0000_0000,
32'hffff_ffff,
32'h0000_0010,

For more details and examples, see section "2.5.1 Integer constants" of the Verilog 1995 standard (https://ieeexplore.ieee.org/document/803556).

Workaround Python Preprocessing Module
To workaround both the escaped identifier and integer literal parsing bugs in Odin II, I wrote a Python module that can "preprocess" Verilog source to transform it into Verilog that Odin II can currently parse. This seems to address the two main issues I am having at the moment, and I wanted to share this in case others come across this issue. See the attached zip file for the module code: verilog_preprocessor.zip. I use Python 3.10 with type annotations. The module only uses standard library imports and should work standalone.

from vtr-verilog-to-routing.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.