|
From: Cary R. <cy...@ya...> - 2014-10-02 23:47:14
|
Hi Orson,
On the surface translation to LLVM IR seems simple, but when you start considering all the extra support needed for the VPI interface, delays, scheduling, etc. it is a much bigger task. It may still be beneficial. To me this turns into an effort like SystemC where there is a large library that needs to be implemented that would allow the base LLVM IR to be used for implementing the code that looks like a normal programming language. Also don't forget that Verilog requires four state variables in the context of normal expressions, etc.
I was actually thinking about this the other day from a CPU architecture point of view. Specifically if we have a standard well thought out instruction set then we could possibly use LLVM, C++, etc. as the micro architecture to implement the base instruction set. Using a standard instruction set may also allow us to synthesize to real hardware all or part of the simulator to generate hardware speedup of the simulation. I think of this like the Java processors for the JVM. The VPI interface or more specifically the system tasks and functions that use the VPI interface in their implementation complicate synthesis significantly. The current vvp interface is like this for procedural code, but the rest of the implementation uses different concepts (e.g. gates, continuous assignments, etc.).
Cary
On Wednesday, October 1, 2014 8:55 AM, Maciej Sumiński <mac...@ce...> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Steve,
Support for variables in VHDL subprograms is already done [1], together
with suitable tests [2].
Now I would like to take care of 'range and 'reverse_range attributes.
I think these should be easily translatable using $left & $right
system functions. For example:
- ---------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
entity range_test is
port (inp : in std_logic_vector(8 downto 4);
outp : out std_logic_vector(8 downto 4));
end range_test;
architecture test of range_test is
begin
process(inp) begin
for i in inp'range loop
outp(i) <= not inp(i);
end loop;
end process;
end test;
- ---------------------------------------------
could be converted to:
- ---------------------------------------------
module range_test(input wire logic[8:4] inp,
output logic[8:4] outp);
always @(inp) begin
longint i;
for (i = $left(inp); i >= $right(inp); i = i - 1) begin
outp[i] <= ~(inp[i]);
end
end
endmodule
- ---------------------------------------------
There is also one thing that kept me pondering recently. I am not that
familiar with vvp principles, but it seems that its assembly-like code
format could be translated to the LLVM Intermediate Representation [3].
It is just a general idea, but maybe ivl could output the LLVM IR that
could be interpreted by llvm together with some kind of simulator runtime.
Has anyone else considered it? Do you already see any obstacles that
would made the task impossibly hard?
Regards,
Orson
[1] https://github.com/steveicarus/iverilog/pull/45
[2] https://github.com/orsonmmz/ivtest/tree/subprogram_test
[3] https://idea.popcount.org/2013-07-24-ir-is-better-than-assembly/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQEcBAEBAgAGBQJULCQKAAoJEBRwGu1hpbJ18FMIAJJvzHTTCSGyMkP1XKkczfhv
4a2PVlvTKtli+D4eDSDZz0Movt8ZukrZeEhlS5y7pzjntRdQgwY4UlGlGtL/Rtif
FOO3vKh7LHV2hv20QLtp31XPnn+dlWhT7em5JE2ZC7AR8oTwgQ2axQfgrJoHMlsa
zQfbDcjNK570r0aQuQ3obVuwC/NCIHZEzi6MNl/bQEeJkUJeT76rdK+t4BznrxdJ
2gNmXvb2grxoiAYA77C7H9iPZFCvC0BWTgiOn21orz/Xy5Mp9IWDVq3vkB0vvVch
XG+vIqYqC3o8u2vZ4wqHAxPncFyW4cnK6Sfgg6W2EeZfZ8ztUse91SDQjnWo6AY=
=vuaA
-----END PGP SIGNATURE-----
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Iverilog-devel mailing list
Ive...@li...
https://lists.sourceforge.net/lists/listinfo/iverilog-devel |