summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodrigo Alejandro Melo <rodrigomelo9@gmail.com>2017-11-28 22:52:42 -0300
committerRodrigo Alejandro Melo <rodrigomelo9@gmail.com>2017-11-28 22:52:42 -0300
commit37e85b47814e2275e80cd2b949338292cb20551b (patch)
tree621e7d3cc6c9e800924efa880334f74f85f3bae2
parentc6fa3c303c7dd2ad8d6a394d0f9c1b9a4685082d (diff)
downloadvhdl2vl-37e85b47814e2275e80cd2b949338292cb20551b.tar.gz
vhdl2vl-37e85b47814e2275e80cd2b949338292cb20551b.zip
Added support to entity instantiations
-rw-r--r--examples/genericmap.vhd7
-rw-r--r--examples/todo.vhd8
-rw-r--r--src/vhd2vl.l2
-rw-r--r--translated_examples/genericmap.v4
4 files changed, 14 insertions, 7 deletions
diff --git a/examples/genericmap.vhd b/examples/genericmap.vhd
index c5275ba..876f159 100644
--- a/examples/genericmap.vhd
+++ b/examples/genericmap.vhd
@@ -95,4 +95,11 @@ begin
memaddr => memaddr,
memdout => memdout
);
+
+ signextend_inst2 : entity work.signextend
+ port map (
+ i => "0000000000000000",
+ o => open
+ );
+
end rtl;
diff --git a/examples/todo.vhd b/examples/todo.vhd
index c0cdbd9..79b3e59 100644
--- a/examples/todo.vhd
+++ b/examples/todo.vhd
@@ -37,16 +37,10 @@ begin
--**************************************************************************
-- Concatenation in port assignament fail
-- uns <= "0000" & X"1"; -- It is supported
--- dut1_i: signextend
+-- dut1_i: entity work.signextend
-- port map (
-- i => "00000000" & X"11", -- But here fail
-- o => open
-- );
- -- Unsupported type of instantiation
--- dut2_i: entity work.signextend
--- port map (
--- i => (others => '0'),
--- o => open
--- );
end rtl;
diff --git a/src/vhd2vl.l b/src/vhd2vl.l
index d5c2ad1..71f87a9 100644
--- a/src/vhd2vl.l
+++ b/src/vhd2vl.l
@@ -66,6 +66,8 @@ void getbasedstring(unsigned skip);
"\x0d\n" |
\n { lineno++;}
+"entity ".*\. {; /* to remove entity instantiation */}
+
"entity" { return ENTITY; }
"is" { return IS; }
"port" { return PORT; }
diff --git a/translated_examples/genericmap.v b/translated_examples/genericmap.v
index 7bd7168..37bc95d 100644
--- a/translated_examples/genericmap.v
+++ b/translated_examples/genericmap.v
@@ -74,5 +74,9 @@ wire [1:0] colour;
.memaddr(memaddr),
.memdout(memdout));
+ signextend signextend_inst2(
+ .i(16'b0000000000000000),
+ .o(/* open */));
+
endmodule
OpenPOWER on IntegriCloud