umarcor on keep-compiling
ci: use the built-in '--keep-co… (compare)
umarcor on cosim
cosim/dpi-ffi: add 'vhdpi_ghdl.… cosim/dpi-ffi: add VHDPI_Test (compare)
umarcor on cosim
WIP setenv (compare)
umarcor on main
cosim/dpi-ffi/ghdl-vffi/test: a… (compare)
umarcor on cosim
umarcor on main
WIP envvars (compare)
umarcor on cosim
WIP envvars (compare)
umarcor on master
umarcor on main
umarcor on cosim
umarcor on master
cosim/dpi-ffi: create subdir 'g… cosim/dpi-ffi: fix compilation … cosim/dpi-ffi/ghd-vffi: use VUn… and 2 more (compare)
umarcor on cosim
ci: add workflow CoSim cosim/dpi-ffi: add README (compare)
umarcor on cosim
ci: add workflow CoSim cosim/dpi-ffi: add README (compare)
umarcor on cosim
cosim/dpi-ffi: create subdir 'g… cosim/dpi-ffi: fix compilation … cosim/dpi-ffi/ghd-vffi: use VUn… and 2 more (compare)
umarcor on top-subtype
umarcor on master
2008: ad tb_top_generic_subtype cosim: add ref to aguinet/drago… (compare)
umarcor on top-subtype
2008: ad tb_top_generic_subtype (compare)
umarcor on top-subtype
2008: ad tb_top_generic_subtype (compare)
umarcor on top-subtype
2008: ad tb_top_generic_subtype (compare)
umarcor on style
Hi! I've got a problem with a generic procedure.
procedure convert_to_type generic (type t)
parameter (constant s : in string; variable v : out t) is
begin
v := t'value(s);
end procedure;
procedure parse(constant s : in string) is
type value_t is (V1, V2, V3, V4);
procedure convert_to_value is new convert_to_type generic map (t => value_t);
variable v : value_t;
begin
convert_to_value("V1", v);
end procedure;
Modelsim reports the following error Attribute "value" requires a scalar type mark prefix.
Is there a way to tell VHDL that the t
type is going to be a scalar ? Or any tricks to overcome this issue ?
(I know I could have used directly value_t'value(v)
but in my code, it's more complex that this MWE)
Thanks
@std-max Unfortunately not in VHDL 2008. on the convert_to_type
procedure, type t
could be literally any type - scalar, composite or access. So t'value
cannot be used because it would be illegal for composite or access types. VHDL 2019 fixes this by allowing you to specify types to be scalar or composite (or just anything).
For example:
procedure some_proc generic( type t is array(natural range<>) of (type is <>) )
Here, you are specifying that the type must be array of a scalar type.
defparam
has been deprecated in SystemVerilog for a while, but no vendor dares remove support for it. So the maintenance burden never goes away.
frelaxed
was meant for mixing revisions.
from module import *
in Python.
numeric_std_unsigned
was only added, IMO, because people were continuing to use, and refused to migrate away from std_logic_unsigned. Again, this is basically the same reason that std_logic_textio was added to the standard
numeric_std_unsigned
in RTL code and would require it in a design team - not to intentionally use it, however, my concern is that it is easy for someone to mistakenly use >
with std_logic_vector. This can result in RTL and GATE implementation mismatches. This is a subtle bug that is hard to find - even with an experienced review team. However, if one were to include numeric_std_unsigned
then >
always has a consistent meaning in both RTL and GATE - and it is easy to review for - did they include the package or not. Hence, using numeric_std_unsigned
makes something that is a design bug into a methodology mistake.
@umarcor There is no longer a reason for a user to use multiple versions of the language. The reason VHDL-93 was used is that historically was the subset of the language used for RTL. Hence, it was a lint tool that made sure you did not introduce something the synthesis tool could not handle. However, you should be able to compile 93 RTL code in 2008 and have it work the same way.
A simulator that only supports one version would work fine. Even with the lint
check. First compile the RTL for 93 as a lint check. Then compile it for 2008 and simulate it with other 2008 code.
warning
was a little to subtle for people - maybe they should have used suppressed warning