Git Product home page Git Product logo

Comments (7)

lattner avatar lattner commented on August 10, 2024

@drom is looking into this

from circt.

drom avatar drom commented on August 10, 2024

About firrtl.shl(x, 4) ==> {x, 4'h0} convertion

FIRRTL

Has two kinds of shift operations:

Static:

image

Dynamic:

image

VerilogRTL

Has shift operators:

  • logical shift operators, << and >>
  • arithmetic shift operators, <<< and >>>

Should we have them in the RTL Dialect?

from circt.

drom avatar drom commented on August 10, 2024

About firrtl.cvt

FIRRTL

image

Verilog RTL

image

Should we have $signed operation type in RTL Dialect?

from circt.

lattner avatar lattner commented on August 10, 2024

Yeah, it is a good question about whether we have signed or unsigned types in RTL dialect. It doesn't really make sense for a hardware oriented dialect to do that, but given the importance of Verilog in practice, it might make sense.

For now, lets stick with signless types. If it becomes a problem in practice we can always revise this.

from circt.

lattner avatar lattner commented on August 10, 2024

Also xref for general background (not saying this is the right thing to do here necessarily): https://mlir.llvm.org/docs/Rationale/Rationale/#integer-signedness-semantics

from circt.

stephenneuendorffer avatar stephenneuendorffer commented on August 10, 2024

Vivado HLS uses LLVM-style signless types for most of the compiler. This causes some subtleties in range analysis which tracks a signed range and an unsigned range for each value. In RTL, signed operations are typically represented like:

wire [8:0] add_ln235_fu_662_p2;
reg [8:0] j_0_reg_360;
assign add_ln235_1_fu_687_p2 = ($signed(9'd482) + $signed(j_0_reg_360));

(In other words, most everything is declared as vectors of bits and signed operations are expressed by always converting the operands to signed. There are a few places where wires are declared as signed, but this is the exception more than the rule.)

from circt.

lattner avatar lattner commented on August 10, 2024

I think this is complete now!

from circt.

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.