The objective is to preload the data from the file to a memory array (behavioral memory
in ram library).
The problem is, the data in the file could be 1 or 2 or 4 bytes and memory array can be
of any width 1 or 2 or 4 bytes. So, I would like to pass ‘width’ as part of the task
argument so that I can split the data read from the file in chunks of the parameter ‘width’.
Now, how do I pass a parameter value to a task?
PS: I do not want to parametrize the class in the task is present, i just need to do it to the task).
You didn’t describe how the data in queue is organized, but assuming it’s just a queue of bytes, you can use the streaming operator in one statement rather than needed to use a foreach loop.
mem_array = {>>{queue}};
If it is more complicated than that, you need to provide more info about how the data is organized and how the method readfile() works. An example of what the file and resulting memory array looks like would be great too.