Skip to content

Unable to use concat with InPort #279

Closed
@KelvinChung2000

Description

@KelvinChung2000

The following example,

from pymtl3 import *


class MasterIfc(Interface):
    def construct(s):
        s.in_ = InPort(b2)


class Test(Component):
    def construct(s):
        s.ins_ = [MasterIfc() for _ in range(4)]
        s.out = OutPort(b8)
        s.out //= concat(s.ins_[0].in_, s.ins_[1].in_, s.ins_[2].in_, s.ins_[3].in_)


if __name__ == "__main__":
    from pymtl3.passes.backends.verilog import VerilogTranslationPass

    m = Test()
    m.elaborate()
    m.set_metadata(VerilogTranslationPass.enable, True)
    m.set_metadata(VerilogTranslationPass.explicit_file_name, "Test.sv")
    m.apply(VerilogTranslationPass())
    m.apply(DefaultPassGroup())

is giving me

  File "/home/kelvin/pymtl3/pymtl3/dsl/Connectable.py", line 184, in __getattr__
    raise AttributeError("{} is not a signals with struct type, and has no attribute '{}'".format( s, name ))
AttributeError: s.ins_[0].in_ is not a signals with struct type, and has no attribute 'nbits'

Is there any way I can work around this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions