Jump to content

bitfield

Members
  • Posts

    2
  • Joined

  • Last visited

bitfield's Achievements

Member

Member (1/2)

0

Reputation

  1. Hello, so the underlying idea of the whole model I'm working on is that it should be generated from a configuration file during runtime. Thats also the reason for the split between BasePort and Port: The component between the adder and the memory (which is a DMA) doesn't need the data as access to the data would require a dynamic cast. See this EDAPlayground link for an example how its used. If the actual data is needed you would have to do a dynamic_cast<> as was already mentioned. Now that I'm thinking about it, you are probably right that this is not a good solution and is, at best, a strange model. I have dug through this forum a bit and stumbled upon sc_bv_base for which you can define the width without relying on templates. So that probably would have been the better idea I think. Any thoughts on this idead? Anyway, I am still curious why the status bits in this implementation are dropped during the transmission. See the according note in dma.cpp in the link. Thank you very much!
  2. Hello, I am currently working on a model that consists of three components: memory, adder and link element between the two of them. The data transmission between them happens via ports that look like sc_in<BasePort*>, so a pointer to the BasePort class. This class only contains the status bits (e.g. valid), while the actual data is part of a child class of BasePort that is just callled Port. Inside the memory an object of type Port will be instatiated, the data will be written to that object, and finally the oject is static casted to an object of type BasePort that will then be written to the output port. The reason for this split is that the linking element should be able to work independently from the underlying data type that is transmitted. The problem I am running into is that the data of BasePort, the status bits, seem to get lost during transmission. So for example, in the linking element I can only see the data while the valid flag will always be set to false, even though it was correctly set in the memory. So, i can see the correct data but the valid flag will not be set. So far I have checked that the pointer that is seen in the linking element is the same as the one that is written in the memory, which is the case. I have also tried chaning the data type of the channels connecting the components from sc_signal<BasePort*> to sc_buffer<BasePort*> but that also didn't fix the issue. I really don't understand why this part of the data transmission is lost. If either all or nothing is lost that would make sense, but I can't think of any reason why only the data of BasePort but not the data of Port is lost. Any thoughts on what I am doing wrong here? Thank you!
×
×
  • Create New...