我一直无法理解如何解引用VHDL中的指针。VHDL中的指针解除引用
我心目中什么是C代码,如:
int a;
int* ptr_a;
a = 42;
ptr_a=&a;
*ptr_a=451;// how can I do this ?
我试图在VHDL来模拟天生验证码:
ptr_test : process
type ptr_integer is access integer;
variable a : integer;
variable ptr_a : ptr_integer;
begin
a := 42;
ptr_a := new integer'(a);
report "ptr now points to a : ptr=" & str(ptr_a.all);
ptr_a.all := 451;
report "ptr modified : ptr=" & str(ptr_a.all);
report "a is NOT modified : a =" & str(a);
wait;
end process;
所以,我怎么能正确地通过指针修改的值?
ptr_b.all在这里表示什么? – Endeavour 2017-02-12 20:46:19
'ptr_b.all'是你如何获得访问类型引用内容的方式。 – 2017-02-13 13:58:17