Git Product home page Git Product logo

Comments (2)

dtzSiFive avatar dtzSiFive commented on September 14, 2024

Related, splitting the declaration from its rwprobe creation:

FIRRTL version 4.0.0

circuit L:
  layer T, bind:

  public module L:
    output p : RWProbe<UInt<1>, T>

    wire w : UInt<1>
    connect w, UInt<1>(0)
    layerblock T:
      define p = rwprobe(w)

Produces:

layers-rwprobe-2.fir:12:18: error: 'firrtl.ref.rwprobe' op has non-local target
      define p = rwprobe(w)
                 ^
layers-rwprobe-2.fir:12:18: note: see current operation: %0 = "firrtl.ref.rwprobe"() {target = #hw.innerNameRef<@L::@sym>} : () -> !firrtl.rwprobe<uint<1>>
// -----// IR Dump After LowerLayers Failed (firrtl-lower-layers) //----- //
"firrtl.circuit"() ({
  "sv.verbatim"() {format_string = "`ifndef layers_L_T\0A`define layers_L_T", output_file = #hw.output_file<"layers_L_T.sv", excludeFromFileList>, symbols = []} : () -> ()
  "firrtl.module"() ({
  ^bb0(%arg1: !firrtl.rwprobe<uint<1>>):
    %3 = "firrtl.ref.rwprobe"() {target = #hw.innerNameRef<@L::@sym>} : () -> !firrtl.rwprobe<uint<1>>
    "firrtl.ref.define"(%arg1, %3) : (!firrtl.rwprobe<uint<1>>, !firrtl.rwprobe<uint<1>>) -> ()
  }) {annotations = [], convention = #firrtl<convention internal>, layers = [], portAnnotations = [], portDirections = array<i1: true>, portLocations = [loc(unknown)], portNames = ["p"], portSyms = [], portTypes = [!firrtl.rwprobe<uint<1>>], sym_name = "L_T", sym_visibility = "private"} : () -> ()
  "firrtl.module"() ({
  ^bb0(%arg0: !firrtl.rwprobe<uint<1>>):
    %0 = "firrtl.wire"() {annotations = [], inner_sym = #hw<innerSym@sym>, name = "w", nameKind = #firrtl<name_kind droppable_name>} : () -> !firrtl.uint<1>
    %1 = "firrtl.constant"() {value = 0 : ui1} : () -> !firrtl.uint<1>
    "firrtl.matchingconnect"(%0, %1) : (!firrtl.uint<1>, !firrtl.uint<1>) -> ()
    %2 = "firrtl.instance"() {annotations = [], layers = [], lowerToBind, moduleName = @L_T, name = "t", nameKind = #firrtl<name_kind droppable_name>, output_file = #hw.output_file<"layers_L_T.sv", excludeFromFileList>, portAnnotations = [[]], portDirections = array<i1: true>, portNames = ["p"]} : () -> !firrtl.rwprobe<uint<1>>
    "firrtl.ref.define"(%arg0, %2) : (!firrtl.rwprobe<uint<1>>, !firrtl.rwprobe<uint<1>>) -> ()
  }) {annotations = [], convention = #firrtl<convention scalarized>, layers = [], portAnnotations = [[]], portDirections = array<i1: true>, portLocations = [loc("layers-rwprobe-2.fir":7:12)], portNames = ["p"], portSyms = [], portTypes = [!firrtl.rwprobe<uint<1>>], sym_name = "L"} : () -> ()
  "sv.verbatim"() {format_string = "`endif // layers_L_T", output_file = #hw.output_file<"layers_L_T.sv", excludeFromFileList>, symbols = []} : () -> ()
}) {annotations = [], name = "L"} : () -> ()

This one's trickier.

It's not possible to always sink the rwprobe target into the layer (could have other users, or target a port).

from circt.

dtzSiFive avatar dtzSiFive commented on September 14, 2024

Second example as written I think should be rejected -- Layers shouldn't have access to write targets outside the layer. This is handled by #7372 .

So I believe that PR as well as #7369 (teaching LowerLayers to support this when it is possible -- target is within the same layer) will resolve this.

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.