diff options
| author | Albert Magyar | 2019-02-01 11:01:35 -0800 |
|---|---|---|
| committer | Adam Izraelevitz | 2019-02-01 11:01:35 -0800 |
| commit | 6b59614462ae8591db999fef9ba0d451e56d1c24 (patch) | |
| tree | 95c8ba8e9a1135fce36f24a5416a16e5e8a93263 /src/main/scala/firrtl/WIR.scala | |
| parent | 4e77c5e14a05cedda621a4acdbc435bed23a202d (diff) | |
Mem helpers (#1010)
* Add memory WRef factory for completeness
* Refactor DefAnnotatedMemory construction for clarity
Diffstat (limited to 'src/main/scala/firrtl/WIR.scala')
| -rw-r--r-- | src/main/scala/firrtl/WIR.scala | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main/scala/firrtl/WIR.scala b/src/main/scala/firrtl/WIR.scala index 0c5c250f..c69d227c 100644 --- a/src/main/scala/firrtl/WIR.scala +++ b/src/main/scala/firrtl/WIR.scala @@ -44,6 +44,8 @@ object WRef { def apply(port: Port): WRef = new WRef(port.name, port.tpe, PortKind, UNKNOWNGENDER) /** Creates a WRef from a WDefInstance */ def apply(wi: WDefInstance): WRef = new WRef(wi.name, wi.tpe, InstanceKind, UNKNOWNGENDER) + /** Creates a WRef from a DefMemory */ + def apply(mem: DefMemory): WRef = new WRef(mem.name, passes.MemPortUtils.memType(mem), WireKind, UNKNOWNGENDER) /** Creates a WRef from an arbitrary string name */ def apply(n: String, t: Type = UnknownType, k: Kind = ExpKind): WRef = new WRef(n, t, k, UNKNOWNGENDER) } |
