Jump to content

Read from buffer without removing content


Effiong

Recommended Posts

Hi all,

 

I want to be able to read an element from a "buffer-like" data structure without removing it. Is there a systemc structure for that ?

 

sc_fifo "nb_read() and read()" methods removes the element from the buffer. I want to be able to decide when to remove or not remove the data.

 

Thanks

Link to post
Share on other sites

Hi all,

 

I want to be able to read an element from a "buffer-like" data structure without removing it. Is there a systemc structure for that ?

 

sc_fifo "nb_read() and read()" methods removes the element from the buffer. I want to be able to decide when to remove or not remove the data.

 

Thanks

 

As I remember, sc_fifo does not have that. But you can create a derived class from sc_fifo with a method to pick value w/o modifying data pointers:

something like:

T pick() {..}

Link to post
Share on other sites

Hi all,

 

I want to be able to read an element from a "buffer-like" data structure without removing it. Is there a systemc structure for that ?

 

sc_fifo "nb_read() and read()" methods removes the element from the buffer. I want to be able to decide when to remove or not remove the data.

 

Thanks

Hello Sir,

A separate buffer nay be created, and the contents of the first buffer copied to the second for examining the 

contents. In fact, a remarkable core C language function "memcpy" can used to copy any number of bytes

from the source to the destination. On any Linux box, type 'man memcpy' at the command prompt, for more

details. Buffers may be cleared with the "memset" function. Maybe this might work for you.

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...