Commit a6b872bf by Zachary Snow

don't pack arrays passed to system tasks

- avoid packing memories used with read mem tasks
- fix detection of $readmem[hb] in logic conversion
parent 5b063ec9
......@@ -206,7 +206,7 @@ traverseStmtM (Timing timing stmt) =
return $ Timing timing stmt
traverseStmtM (Subroutine (Ident f) args) = do
case args of
Args [_, Ident x, _] [] ->
Args (_ : Ident x : _) [] ->
if f == "$readmemh" || f == "$readmemb"
then collectLHSM $ LHSIdent x
else return ()
......
......@@ -94,6 +94,8 @@ traverseStmtM =
traverseStmtArgsM
traverseStmtArgsM :: Stmt -> ST Stmt
traverseStmtArgsM stmt @ (Subroutine (Ident ('$' : _)) _) =
return stmt
traverseStmtArgsM stmt @ (Subroutine _ (Args args [])) =
mapM_ flatUsageM args >> return stmt
traverseStmtArgsM stmt = return stmt
......
......@@ -20,4 +20,7 @@ module top;
#1 arr2[2] = 9; dump(arr2);
#1 arr2[3] = 7; dump(arr2);
end
byte arr3 [4];
wire [31:0] arr3_flat = {arr3[0], arr3[1], arr3[2], arr3[3]};
initial $readmemh("tf_unpacked_input.mem", arr3);
endmodule
......@@ -19,4 +19,7 @@ module top;
#1 arr2[2] = 9; dump(arr2);
#1 arr2[3] = 7; dump(arr2);
end
reg [7:0] arr3 [0:3];
wire [31:0] arr3_flat = {arr3[0], arr3[1], arr3[2], arr3[3]};
initial $readmemh("tf_unpacked_input.mem", arr3);
endmodule
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment