Commit 77dd1011 by Zachary Snow

support multiple assignments in one `assign`

parent 89de289b
...@@ -637,8 +637,8 @@ NonGenerateModuleItem :: { [ModuleItem] } ...@@ -637,8 +637,8 @@ NonGenerateModuleItem :: { [ModuleItem] }
-- This item covers module instantiations and all declarations -- This item covers module instantiations and all declarations
: DeclTokens(";") { parseDTsAsModuleItems $1 } : DeclTokens(";") { parseDTsAsModuleItems $1 }
| ParameterDecl(";") { map (MIPackageItem . Decl) $1 } | ParameterDecl(";") { map (MIPackageItem . Decl) $1 }
| "defparam" DefparamAsgns ";" { map (uncurry Defparam) $2 } | "defparam" LHSAsgns ";" { map (uncurry Defparam) $2 }
| "assign" opt(DelayControl) LHS "=" Expr ";" { [Assign $2 $3 $5] } | "assign" opt(DelayControl) LHSAsgns ";" { map (uncurry $ Assign $2) $3 }
| AlwaysKW Stmt { [AlwaysC $1 $2] } | AlwaysKW Stmt { [AlwaysC $1 $2] }
| "initial" Stmt { [Initial $2] } | "initial" Stmt { [Initial $2] }
| "genvar" Identifiers ";" { map Genvar $2 } | "genvar" Identifiers ";" { map Genvar $2 }
...@@ -750,10 +750,10 @@ NOutputGateKW :: { NOutputGateKW } ...@@ -750,10 +750,10 @@ NOutputGateKW :: { NOutputGateKW }
: "buf" { GateBuf } : "buf" { GateBuf }
| "not" { GateNot } | "not" { GateNot }
DefparamAsgns :: { [(LHS, Expr)] } LHSAsgns :: { [(LHS, Expr)] }
: DefparamAsgn { [$1] } : LHSAsgn { [$1] }
| DefparamAsgns "," DefparamAsgn { $1 ++ [$3] } | LHSAsgns "," LHSAsgn { $1 ++ [$3] }
DefparamAsgn :: { (LHS, Expr) } LHSAsgn :: { (LHS, Expr) }
: LHS "=" Expr { ($1, $3) } : LHS "=" Expr { ($1, $3) }
PackageItems :: { [PackageItem] } PackageItems :: { [PackageItem] }
......
module top; module top;
wire [31:0] a; wire [31:0] a;
wire [0:31] b; wire [0:31] b;
assign a = 'h64ded943; assign a = 'h64ded943, b = 'hb7151d17;
assign b = 'hb7151d17;
initial begin initial begin
$display(a[0+:8]); $display(a[0+:8]);
$display(a[15-:8]); $display(a[15-:8]);
......
module top; module top;
wire [31:0] a; wire [31:0] a;
wire [0:31] b; wire [0:31] b;
assign a = 'h64ded943; assign a = 'h64ded943, b = 'hb7151d17;
assign b = 'hb7151d17;
initial begin initial begin
$display(a[7:0]); $display(a[7:0]);
$display(a[15:8]); $display(a[15:8]);
......
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