cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
alirahiminezhad
Visitor
Visitor
445 Views
Registered: ‎09-07-2020

shift register and SIPO in XSG

hi

How can I access the values of a matrix separately?

I want values of Matrix 4*4 divide into 4 part, and store them in register then do some operation on them.

i work with xilinx system generator in matlab simulink

my function is :

function [D1,D2,D3,D4 ]= shiftRegister(In)
persistent regs, regs = xl_state(zeros(1, 4), In);
D1=regs(0);
D2=regs(1);
D3=regs(2);
D4=regs(3);
for m=0:3
D1=D1+regs(4*m-4);
D2=D2+regs(4*m-3);
D3=D3+regs(4*m-2);
D4=D4+regs(4*m-1);
end
regs.push_front_pop_back(In);
end

tnx alot

plz see my pictures

and plz guide me and help me

Regards

Ali

ask.png
error.PNG
circuit.PNG
0 Kudos
1 Reply
vkanchan
Xilinx Employee
Xilinx Employee
360 Views
Registered: ‎09-18-2018

Hi @alirahiminezhad ,

The input port of m-code block is named as 'In' which is a keyword in VHDL. Please avoid using HDL keywords for naming in Sysgen designs.

0 Kudos