Forum Discussion
Altera_Forum
Honored Contributor
9 years agoYou accum assigned before the begin. It must be assigned inside the begin - end pair. before the begin is for declarations only.
But there are several other issues here: Why have you declared the mat1 and mat2 types as 2d array with really only 1 dimension? why not just write: type Mat1 is array (0 to 1) of integer range 0 to 256; This allows acum to be assigned as you did: acum <= (0,0); with you current declaration: type Mat1 is array (0 to 1, 0 to 0) of integer range 0 to 256; you need to assign acum like this: acum <= ( (0), (0) ); Next - what do you expect the for loops to do in your code? loops are unrolled when the code is compiled. Apart from the fact that out_im is currently unconnected, your signals only get the last value assigned to then, so add_rom will always be +1, pixel will always be (256, 256) and acum cannot assigned because you didnt define a + function for your Mat2 type. This looks rather like a software program, not HDL.