Forum Discussion

rafaelcorsi's avatar
rafaelcorsi
Icon for New Contributor rankNew Contributor
6 years ago

On HLS device is it possible to have the base address (pointer offset) of a MM_Master interface on the Control and Status Register (CSR), besides the default conduit.

On my project I have this component:

typedef ihc::mm_master<unsigned char, ihc::aspace<1>,
                       ihc::awidth<32>,
                       ihc::dwidth<8> > Master1;
typedef ihc::mm_master<unsigned char, ihc::aspace<2>,
                       ihc::awidth<32>,
                       ihc::dwidth<8> > Master2;
 
 
hls_avalon_slave_component
component void imgOffSet(Master1& imgIn,
                         Master2& imgOut,
                         hls_avalon_slave_register_argument int N) {
  for(int y=0; y < N; y++){
    #pragma unroll 8
    for (int x=0; x < N; x++){
      int px = pxToMem(x,y,N);
      printf("%d \n", px);
      unsigned int tpx = ((unsigned int) imgIn[px])+OFFSET;
      if(tpx > 255)
        imgOut[px]= 255;
      else
        imgOut[px]= tpx;
    }
	}
}

The problem is that the HLS creates two conduits that is the base address of ImgIn and ImgOut, I would like to have this address on the already existent CSR register, that is accessible by the Slave port created by the compiler, as shown bellow:

2 Replies