File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed
Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -748,7 +748,9 @@ outputADefToADefs (ADef { adef_type = t, adef_expr = e }) [resName] =
748748 adef_type = t,
749749 adef_expr = e,
750750 adef_props = [] }]
751- outputADefToADefs _ _ = internalError " outputADefToADefs: unexpected ADef resNames"
751+ outputADefToADefs (ADef { adef_type = ATBit 0 }) [] = []
752+ outputADefToADefs def resNames =
753+ internalError $ " outputADefToADefs: unexpected ADef resNames: " ++ ppReadable (def, resNames)
752754
753755getVInst :: AId -> [AVInst ] -> AVInst
754756getVInst i as = head ( [ a | a <- as, i == (avi_vname a) ] ++
Original file line number Diff line number Diff line change @@ -730,19 +730,18 @@ tiExpr as td exp@(CmoduleVerilog name ui clks rsts args fields sch ps) = do
730730 then errUnexpectedEnable " value" t
731731 else errBadResType t
732732 chkResType ps Nothing [] t = do
733- -- must have more than 0 ports
734- when (null ps) $
735- err (getPosition f,
736- EForeignModTooFewPorts (pfpString f))
737733 -- update the Classic fieldinfo to BSV format
738734 let inputs = initOrErr " chkResType" ps
739735 let final_port = lastOrErr " chkResType" ps
740736 -- XXX kill PrimAction once imports in Prelude are converted over
741737 if (isActionWithoutValue t) || (isPrimAction t)
742- then return (inputs, Just final_port, [] )
743- else if (isBitTuple t)
744- then return (inputs, Nothing , [final_port])
745- else errBadResType t
738+ then return (inputs, Just final_port, [] )
739+ else if (isBitTuple t)
740+ -- XXX should have multiple output ports for bit tuples here?
741+ then return (inputs, Nothing , [final_port])
742+ else if (t == tPrimUnit)
743+ then return (ps, Nothing , [] )
744+ else errBadResType t
746745
747746 errBadResType t =
748747 err (getPosition f,
You can’t perform that action at this time.
0 commit comments