Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Intel Community
- FPGAs and Programmable Solutions
- Intel® Quartus® Prime Software
- Can't determine definition of operator ""srl""

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Highlighted
##

Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-15-2016
01:45 PM

1,621 Views

Can't determine definition of operator ""srl""

Hallo

This is my first project with Altera. I am using the quatras 2 synthesis tool and simulink to generate a design for my FPGA. But when i try to synthesis the code i get the following error can't determine definition of operator ""srl"" i tried google, but did not get a clear explanation. What i understood is srl is a command to shift right logically. Can any one please explain me in details what is the cause of this problem?
10 Replies

Highlighted
##

Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-15-2016
05:28 PM

36 Views

It is, but it is only defined for unsigned and signed types. Post the code and we can have a look.

Highlighted
##

Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-15-2016
05:47 PM

36 Views

Hallo Tricky

Thanks for the quick reply. Here is my Matlab function for a CIC filter. I get the error on the line where i cast the x. I am not sure if the next parts of the code will also produce some error. function y = CIC4FPGA( x ) % 4th order CIC filter with 2 times oversampling % over = cast(2,'int32'); x = cast(x/8,'int32'); % this line shows the error persistent comb integrator if isempty( comb ) comb = cast(zeros(4,1),'int32'); integrator = cast(zeros(4,1),'int32'); end xx= cast(zeros(length(x)*over, 1),'int32'); y = cast(zeros(length(x)*over, 1),'int32'); a = cast(0,'int32'); b = cast(0,'int32'); % Calculate Comb stage for i = 1:length(x) a = x(i) - comb(1); comb(1) = x(i); b = a - comb(2); comb(2) = a; a = b - comb(3); comb(3) = b; b = a - comb(4); comb(4) = a; xx( 2*( i-1) + 1 ) = b; % insert (over - 1) zeros end; for i=1:length(xx) integrator(1) = integrator(1) + xx(i); integrator(2) = integrator(2) + integrator(1); integrator(3) = integrator(3) + integrator(2); integrator(4) = integrator(4) + integrator(3); y(i) = integrator(4); end;
Highlighted
##

The matlab code is not causing the error. I assume you're using hdl coder to generate the hdl for quartus. Can you post this code? And what version of matlab is it?

Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-15-2016
06:33 PM

36 Views

Highlighted
##

Yes i am using HDL coder from Simulink. I have MATALB 2014. The setup i have is a like the attached image. I make a subsytem out of the FIR interpolation filter and the CIC function. I am also attaching the CIC filter HDL code that i generate. I get the error at line 92 of the CIC filter file. If you need i can upload you the whole Simulink file and my function block.

Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-15-2016
07:28 PM

36 Views

Highlighted
##

For some reason it is trying to shift a real, which is not possible. You need to convert all of your code to use fixed point numbers, not floating, because floating will not be synthesisable.

Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-16-2016
07:18 AM

36 Views

Highlighted
##

Yes i know that floating point is not synthesisable. That's why i convert my variables to 'int32' using the cast command. MATLAB treats 'int32' as a fixed point (1,32,0) in this format. So i guess this is not the problem. But any idea for which loop or some structure in my code it tries to shift a real? I really did not understand the part 'it is trying to shift a real'. can you please clear this error, so i can pass it to my boss and maybe he has an idea

Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-16-2016
07:34 AM

36 Views

Highlighted
##

Move the cast external to the code that is converted to hdl. Do not have any floating point in any code that will be converted to hdl. Have all inputs as int 32 type.

Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-16-2016
08:50 AM

36 Views

Highlighted
##

Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-16-2016
08:51 AM

36 Views

The srl is caused by the x/8 in your matlab.

Highlighted
##

Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-16-2016
10:09 AM

36 Views

Hallo

So did a change in the MATLAB code and it complets the logic synthesis now. i changed the x to x = bitshift(x,-3) %bitshift is a builting MATLAB function My next question is to perform mapping is it necessary to have the device connected to the pc? I still dont have a development board from ALTERA. Can i post the questions with the mapping later on this thread or should i ask it on a new thread?
Highlighted
##

Up to you were you post. You will need the board connected via jtag value to program it. As for data it depends what methods you are using to send the data. If its all via matlab it may have ethernet support. But I you may need to contact mathworks or a matlab forum for support.

Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-16-2016
02:42 PM

36 Views

For more complete information about compiler optimizations, see our Optimization Notice.