我一直無法理解如何解引用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