Skip to content

Commit

Permalink
Fix Verilog style variable value rendering.
Browse files Browse the repository at this point in the history
  • Loading branch information
whitequark committed Oct 10, 2024
1 parent 71027d2 commit 509f1e8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/model/styling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ export function variableValue(style: DisplayStyle, variable: Variable, value: bi
}

case DisplayStyle.Verilog:
return `${radix}'${value.toString(radix)}`;
switch (radix) {
case 2: return `${variable.width}'b${value.toString(2)}`;
case 8: return `${variable.width}'o${value.toString(8)}`;
case 10: return `${variable.width}'d${value.toString(10)}`;
case 16: return `${variable.width}'h${value.toString(16)}`;
}

case DisplayStyle.VHDL:
switch (radix) {
Expand Down

0 comments on commit 509f1e8

Please sign in to comment.