سلام .
توی برنامه نیاز داشتم که که دو مقدار را به یک ماتریس6×1 اضافه کنم و اونا به یک ماتریس 8×1 ارتقا بدم این دو ماتریس در یک package تعریف شده اند که به عنوان ورودی 2 بلوک مالتی پلکسر هستند
این package تعریف شده می باشد
و از این دستور برای اضافه کردن استفاده کردم
و هنگان run کردن این خطا را می دهد :
no feasible entries for indix operator "&"
بعد ای نها را جایگزین کردم
و خطای زیر را داد ؟
index constraint cannot be applied to already_constrained type work.observer.matrix6x1
توی برنامه نیاز داشتم که که دو مقدار را به یک ماتریس6×1 اضافه کنم و اونا به یک ماتریس 8×1 ارتقا بدم این دو ماتریس در یک package تعریف شده اند که به عنوان ورودی 2 بلوک مالتی پلکسر هستند
این package تعریف شده می باشد
کد:
package observer is -- define package type matrix8x1 is array (1 to 8) of integer; type matrix7x1 is array (1 to 7) of integer; type matrix6x1 is array (1 to 6) of integer; type matrix4x1 is array (1 to 4) of integer; type matrix2x1 is array (1 to 2) of integer; type time_simulation is range 0 to 1E5 units ps; ns=1000 ps; us=1000 ns; ms=1000 us; s=1000 ms; end units; --function Now return Time; end observer;
کد:
port (in_o:in matrix6x1; ... signal s:matrix2x1; signal newinput:matrix8x1; ... begin ... s<=(1000,1000); newinput<= matrix8x1(in_o & s) ;
no feasible entries for indix operator "&"
بعد ای نها را جایگزین کردم
کد:
subtype m2x[left][/left]1 is matrix6x1(1 to 2); signal s:m2x1;
index constraint cannot be applied to already_constrained type work.observer.matrix6x1