|
From: Maciej S. <mac...@ce...> - 2015-02-19 17:07:37
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Hi Steve,
I have another update[1] along with tests[2] that brings:
- - enum can be used as a port type in modules (SystemVerilog)
- - shift operators (SRL/SLL/SRA/SLA) (VHDL)
- - labeled assignments (VHDL)
- - fixed accessing words in constant arrays of vectors (VHDL)
- - 'natural' type translated as 'int unsigned' (VHDL)
- - a bunch of minor fixes
The implementation of the fourth point may seem a bit twisted,
therefore deserves a word of explanation:
Currently, constant arrays of vectors are flattened to single
one-dimensional localparams, as there is no support for constant
unpacked arrays. Therefore, if the user wants to access a particular
word, then it is necessary to extract the adequate part of the
localparam, and it is done by adjusting the indices. Without the
adjustment, only a single bit would be returned.
To give an example:
== VHDL ==
type uns_array is array (natural range <>) of unsigned(7 downto 0);
constant const_array : uns_array(2 downto 0) :=
(0 => "00110011", 1 => "101010101", 2=> "00001111");
target_var := const_array(1);
== SystemVerilog ==
localparam const_array = { 8'b00110011, 8'b10101010, 8'b00001111 };
target_var = const_array[15:8]; // <- indices adjusted to pick the word
It can be easily changed once the unpacked constant arrays are supported.
Regards,
Orson
1. https://github.com/steveicarus/iverilog/pull/54
2. https://github.com/orsonmmz/ivtest/tree/const_array_test
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQEcBAEBCAAGBQJU5hhHAAoJEBRwGu1hpbJ1YrEIALby4wjqftFupoXI+k6OKLAk
Iz7FF265vh+oW37cKlIujAz88PWuaWkx8kIAgaK4ZQateBH5pFdypSz/vVxW8nKg
nUVvgVESxcfgFIb3Jd05PrLb86Du/eU7p5RVngAPSwkabT9DohpS6YwjoJD3N3cv
k7tEPnHLB6A4Zv7kO1yDshTF2ay23eWvK9KvbI43f8D0UwIOb7mVc0hiINnK8gdP
3icurhKWYMbCBATaOh9JgMIPSqCBUi2kW95+srJ9bOZwFu0eYu8ScmsQVe54PGnL
czcwFbc00KxhkV2J5hil0UEn/K8v8Uy3lNu5XaWhupbNefrX5ca+1QBJhJ35/98=
=kbLg
-----END PGP SIGNATURE-----
|