Giter VIP home page Giter VIP logo

Comments (9)

stephenneuendorffer avatar stephenneuendorffer commented on June 2, 2024 1

Generally for memory inference to work you want something like:
reg [DWIDTH-1:0] ram[0:MEM_SIZE-1];

from circt.

amaleewilson avatar amaleewilson commented on June 2, 2024 1

@lattner I think option 2 is most intuitive.

from circt.

lattner avatar lattner commented on June 2, 2024 1

It could be good to bring this up on the forum to see if others have an opinion, it would also be worth looking at what LLHD is doing here.

from circt.

lattner avatar lattner commented on June 2, 2024

Interesting, is the 'packed vs unpacked' distinction just simulator performance, or is there something else going on here?

It seems like there are a couple of ways we could model this:

  1. we could model this with a list of dimensions, then a "number of packed dimensions" integer in the type.
  2. we could model this as a single "packed vector" and "unpacked vector" type that compose onto each other.

I think the major distinction should be how these compose with non-bit types like the SystemVerilog bundle types.

from circt.

solomatnikov avatar solomatnikov commented on June 2, 2024

FYI https://www.veripool.org/issues/1656-Verilator--RFC-Relaxing-UNOPTFLAT-by-dividing-unpacked-array#note-1

Something to keep in mind when generating arrays b/c Verilator is the most used open source simulator.

from circt.

drom avatar drom commented on June 2, 2024

4D array

//      2     1        3     4
logic [1:5] [7:0] v4 [1:7] [1:8];

1,2 = packed dimensions - guaranteed to be represented as a contiguous set of bits.
3,4 = unpacked dimentions - can be resized (grow, shrink)

1 varies most rapidly, followed by 2,3,4

from circt.

drom avatar drom commented on June 2, 2024

All N packed dimensions have to compose first before to compose with M unpacked dimensions.
Could we make sure that packed type can compose into primitive or packed type only, while unpacked can compose into primitive, packed or unpacked.

from circt.

teqdruid avatar teqdruid commented on June 2, 2024

I'm not sure if we ended up discussing this in one of the meetings, but I'm planning on adding a tensor type to the RTL dialect. I welcome additional input!

from circt.

lattner avatar lattner commented on June 2, 2024

We now have ArrayType (packed) and UnpackedArrayType, I think this is done.

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.