diff options
| author | azidar | 2015-05-01 11:02:46 -0700 |
|---|---|---|
| committer | azidar | 2015-05-01 11:02:46 -0700 |
| commit | 0a00a6aaa846b695a7a750cf40079d56a9bb94d6 (patch) | |
| tree | b9d940fefdfdcd04afb6e88906bff6ee6c229244 /src | |
| parent | a0834153e1e5a506dc66d8d792f6f9594052b546 (diff) | |
Fixed bug where the enable was looked at for lowering MUX.
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/stanza/passes.stanza | 8 | ||||
| -rw-r--r-- | src/main/stanza/primop.stanza | 2 |
2 files changed, 1 insertions, 9 deletions
diff --git a/src/main/stanza/passes.stanza b/src/main/stanza/passes.stanza index 4c706087..e67ec21f 100644 --- a/src/main/stanza/passes.stanza +++ b/src/main/stanza/passes.stanza @@ -729,12 +729,6 @@ defn expand-expr (e:Expression) -> List<EF> : val len = num-elems(type(e)) val ret = headn(tailn(exps,begin),len) for r in ret map : EF(exp(r),DEFAULT) - ;val b = exp(e) - ;val exps = for x in generate-entry(name(b as WRef),type(b)) map : - ;EF(WRef(name(x),type(x),NodeKind(),gender(e)),DEFAULT) - ;val begin = index-of-elem(type(b) as BundleType,name(e)) - ;val len = num-elems(type(e)) - ;headn(tailn(exps,begin),len) (e:WIndex) : val exps = expand-expr(exp(e)) val len = num-elems(type(e)) @@ -755,8 +749,6 @@ defn lower-ports (ports:List<Port>) -> List<Port> : defn type (s:WDefAccessor) -> Type : type(type(source(s)) as VectorType) defn size (s:DefMemory) -> Int : size(type(s)) defn size (s:WDefAccessor) -> Int : size(type(source(s)) as VectorType) -defn kind (e:WSubfield) -> Kind : kind(exp(e) as WRef|WSubfield|WIndex) -defn kind (e:WIndex) -> Kind : kind(exp(e) as WRef|WSubfield|WIndex) defn base-name (e:Expression) -> Symbol : match(e) : (e:WRef) : name(e) diff --git a/src/main/stanza/primop.stanza b/src/main/stanza/primop.stanza index 60868799..b293da52 100644 --- a/src/main/stanza/primop.stanza +++ b/src/main/stanza/primop.stanza @@ -182,7 +182,7 @@ public defn lower-and-type-primop (e:DoPrim) -> DoPrim : NEQUAL-SS-OP : DoPrim(op(e),args(e),consts(e),u()) MUX-OP : DoPrim{_,args(e),consts(e),of-type(args(e)[0])} $ - match(type(args(e)[0]),type(args(e)[1])) : + match(type(args(e)[1]),type(args(e)[2])) : (t1:UIntType, t2:UIntType) : MUX-UU-OP (t1:SIntType, t2:SIntType) : MUX-SS-OP MUX-UU-OP : DoPrim(op(e),args(e),consts(e),u()) |
