Skip to content

Commit

Permalink
Merge pull request #130 from DFiantHDL/i129
Browse files Browse the repository at this point in the history
Fix #129
  • Loading branch information
soronpo authored May 10, 2024
2 parents 065eb78 + 7fd0cbe commit 3b4d0cb
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class VHDLPrinter(using val getSet: MemberGetSet, val printerOptions: PrinterOpt
|function to_slv(A : unsigned) return std_logic_vector;
|function to_slv(A : signed) return std_logic_vector;
|function to_slv(A : boolean) return std_logic_vector;
|function to_slv(A : std_logic) return std_logic_vector;
|function to_sl(b : boolean) return std_logic;
|function to_bool(sl : std_logic) return boolean;
|function resize(A : std_logic_vector; new_length : integer) return std_logic_vector;
Expand Down Expand Up @@ -118,6 +119,14 @@ class VHDLPrinter(using val getSet: MemberGetSet, val printerOptions: PrinterOpt
| return "0";
| end if;
|end;
|function to_slv(A : std_logic) return std_logic_vector is
|begin
| if A = '1' then
| return "1";
| else
| return "0";
| end if;
|end;
|function to_sl(b : boolean) return std_logic is
|begin
| if (b) then
Expand Down
3 changes: 3 additions & 0 deletions lib/src/test/scala/issues/IssueSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ class IssuesSpec extends FunSuite:
test("i126 compiles and passes VHDL linting"):
given options.CompilerOptions.Backend = backends.vhdl
i126.TypeConvertIssue().compile.lint
test("i129 compiles and passes VHDL linting"):
given options.CompilerOptions.Backend = backends.vhdl
i129.StdLogicConvIssue().compile.lint
11 changes: 11 additions & 0 deletions lib/src/test/scala/issues/i129.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// format: off
package issues.i129

import dfhdl.*

class StdLogicConvIssue() extends RTDesign:
val a = Bits(10) <> IN
val e = Bits(10) <> OUT

e := (a(0), a(3), b"0", false.bit, b"000000")

0 comments on commit 3b4d0cb

Please sign in to comment.