Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Language/SystemVerilog/AST/ModuleItem.hs
Original file line number Diff line number Diff line change
Expand Up @@ -114,18 +114,22 @@ instance Show AlwaysKW where

data NInputGateKW
= GateAnd
| GateBufif0
| GateNand
| GateOr
| GateNor
| GateRpmos
| GateXor
| GateXnor
deriving Eq

instance Show NInputGateKW where
show GateAnd = "and"
show GateBufif0 = "bufif0"
show GateNand = "nand"
show GateOr = "or"
show GateNor = "nor"
show GateRpmos = "rpmos"
show GateXor = "xor"
show GateXnor = "xnor"

Expand Down
2 changes: 2 additions & 0 deletions src/Language/SystemVerilog/Parser/Parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -873,9 +873,11 @@ OptGateName :: { (Identifier, [Range]) }

NInputGateKW :: { NInputGateKW }
: "and" { GateAnd }
| "bufif0" { GateBufif0 }
| "nand" { GateNand }
| "or" { GateOr }
| "nor" { GateNor }
| "rpmos" { GateRpmos }
| "xor" { GateXor }
| "xnor" { GateXnor }
NOutputGateKW :: { NOutputGateKW }
Expand Down
6 changes: 5 additions & 1 deletion test/basic/gate.sv
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ module top;
wire output_and_delay;
wire output_not;
wire output_buf_delay;
wire output_bufif0_delay;
wire output_rpmos;

and (output_and, input_a, input_b);
and #1 (output_and_delay, input_a, input_b);
not (output_not, input_a);
buf #2 foo_name (output_buf_delay, input_a);
bufif0 (output_bufif0_delay, input_a, input_b);
rpmos (output_rpmos, input_a, input_b);

wire output_nand, output_or, output_nor, output_xor, output_xnor;
nand (output_nand, input_a, input_b);
Expand All @@ -23,7 +27,7 @@ module top;
$monitor("%3d ", $time,
input_a, input_b,
output_and, output_and_delay,
output_not, output_buf_delay,
output_not, output_buf_delay, output_bufif0_delay,
output_nand, output_or, output_nor, output_xor, output_xnor);

#1;
Expand Down