Jump to content

Search the Community

Showing results for tags 'fifo'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Accellera Systems Initiative
    • Information
    • Announcements
    • In the News
  • SystemC
    • SystemC Language
    • SystemC AMS (Analog/Mixed-Signal)
    • SystemC TLM (Transaction-level Modeling)
    • SystemC Verification (UVM-SystemC, SCV)
    • SystemC CCI (Configuration, Control & Inspection)
  • UVM (Universal Verification Methodology)
    • UVM 2017 - Methodology and BCL Forum
    • UVM SystemVerilog Discussions
    • UVM Simulator Specific Issues
    • UVM Commercial Announcements
    • UVM (Pre-IEEE) Methodology and BCL Forum
    • UVM 1.2 Public Review
  • Portable Stimulus
    • Portable Stimulus Discussion
  • IP-XACT
    • IP-XACT Discussion
  • IEEE 1735/IP Encryption
    • IEEE 1735/IP Encryption Discussion
  • OCP (Open Core Protocol)
  • UCIS (Unified Coverage Interoperability Standard)
  • Commercial Announcements
    • Announcements

Categories

  • SystemC
  • UVM
  • UCIS
  • IEEE 1735/IP Encryption

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Biography


Location


Interests


Occupation


Company

Found 9 results

  1. Hi , I am trying to trace out the wave for the input and the output. I have tried for different ways,but not getting the desired results. One of the way was,i created 2 same signals with diff. name in testbench file and tried to trace ,but i was not successful in doing so. Any suggestions to do? Thank you. 🙂 Ps:- I have attached the code through which m trying to trace.Plz,help me out with this.I have modified the code according to the errors,So thats the reason for using namespace sc::core while declaring fifo tracing input.I am posting full code along with the errors. /////////ERRORS///////////////////////////////////// testbench.cpp: In function 'int sc_main(int, char**)':testbench.cpp:16:18: error: no match for call to '(sc_core::sc_fifo<sc_dt::sc_int<32> >) (sc_core::sc_fifo_in<int>&)'testbench.cpp:17:19: error: no match for call to '(sc_core::sc_fifo<sc_dt::sc_int<32> >) (sc_core::sc_fifo_out<int>&)'testbench.cpp:21:29: error: no matching function for call to 'sc_trace(sc_core::sc_trace_file*&, sc_core::sc_fifo_in<int>&, const char [6])' ////////////////////CODE///////////////////////////// #ifndef EXAMPLE_H #define EXAMPLE_H using namespace sc_dt; typedef sc_int<32> sc_int32; SC_MODULE(example) sc_fifo<sc_int32> fifo; //producer thread void producer_thread(); //consumer thread void consumer_thread(); SC_CTOR(example) : fifo(2) { SC_THREAD(producer_thread); SC_THREAD(consumer_thread); }; }; #endif ///////////////////////////////////////// #include <systemc.h> #include "example.h" using namespace sc_dt; void example::producer_thread() { int unsigned number_of_accesses = 4; for (int i = 0; i < number_of_accesses; i++) { sc_int32 value(i); cout << "[" << sc_time_stamp() << "] writing to FIFO value: " << value << ", free: " << fifo.num_free() << endl; fifo.write(value); cout << "[" << sc_time_stamp() << "] wrote to FIFO value: " << value << endl; wait(1, SC_NS); } } //consumer thread void example::consumer_thread() { sc_int<32> value(0); for (;;) { wait(4, SC_NS); fifo.read(value); cout << "[" << sc_time_stamp() << "] read from FIFO value: " << value << endl; } } ////////////////////////////////////////////////MAIN.CPP//////////////////// #include "systemc.h" #include "example.h" using namespace sc_dt; int sc_main(int, char* []) { sc_core::sc_fifo_out<int> output1; sc_core::sc_fifo_in<int> input1; //create the instance of the example example eg1("example_inst"); eg1.fifo(input1); eg1.fifo(output1); sc_trace_file*tf=sc_create_vcd_trace_file("fi"); sc_trace(tf,input1,"input"); sc_trace(tf,output1,"output"); sc_start(); if(not sc_end_of_simulation_invoked()) { sc_stop; } sc_close_vcd_trace_file(tf); return 0; }
  2. veeresh k

    fifo waveform tracing

    Hey everyone, I am trying to trace out the wave for the input and the output. I have tried for different ways,but not getting the desired results. One of the way was,i created 2 same signals with diff. name in testbench file and tried to trace ,but i was not successful in doing so. Any suggestions to do? Thank you. 🙂 Ps:- I have attached the code through which m trying to trace.Plz,help me out with this.I have modified the code according to the errors,So thats the reason for using namespace sc::core while declaring fifo tracing input. ///////////////////////////////////////////// using namespace sc_dt; int sc_main(int, char* []) { sc_core::sc_fifo_out<int> output1; sc_core::sc_fifo_in<int> input1; //create the instance of the example example eg1("example_inst"); eg1.fifo(input1); eg1.fifo(output1); sc_trace_file*tf=sc_create_vcd_trace_file("fi"); sc_trace(tf,input1,"input"); sc_trace(tf,output1,"output"); sc_start(); if(not sc_end_of_simulation_invoked()) { sc_stop; } sc_close_vcd_trace_file(tf); return 0; }
  3. veeresh k

    fifo example

    Hi. I have taken this example from a book and tried to execute it,But i got few errors. I have compared this code with std 2011 and made changes according to that like using namspace sc_core . I am not able to find a right solution for this one. Can someone plese help me out with this.I have posted the code below along with the error,check it out. Thank you. //error////////// In file included from testbench.cpp:6:0:head1.h: In member function 'void www::woperation()':head1.h:16:9: error: 'class sc_core::sc_port<sc_core::sc_fifo_out_if<int> >' has no member named 'write'In file included from testbench.cpp:7:0:head2.h: In member function 'void rrr::roperation()':head2.h:17:9: error: 'class sc_core::sc_port<sc_core::sc_fifo_in_if<int> >' has no member named 'read'  ////////code///// #include<systemc.h> #include"Head1.h" #include"Head2.h" int sc_main(int argc, char* argv[]) { sc_fifo<int> fifo(10); writer w("writer"); reader r("reader"); w.out(fifo); r.in(fifo); sc_start(-1); return 0; } //header1 #include<systemc.h> SC_MODULE(reader) { sc_port<sc_fifo_in_if<int> > in; void roperation() { int val; while (true) { wait(10, SC_NS) for (int i = 0; i <= 15; i++) { in.read(val); cout << val << endl; } } cout << "Availaible : " << in.num availaible() << endl; } SC_CTOR(writer) { SC_THREAD(woperation); } }; //header2 #include<systemc.h> SC_MODULE(writer) { sc_port<sc_fifo_out_if<int> > out; void woperation() { int val = 0; while (true) { wait(10, SC_NS); for (int i = 0; i <= 20; i++) { out.write(val++); } } } SC_CTOR(writer) { SC_THREAD(woperation); } };
  4. veeresh k

    basic fifo example error

    Hi. I am tring to execute a example from a book,but am getting error of this kind : In file included from testbench.cpp:6:0:head1.h: In member function 'void www::woperation()':head1.h:16:9: error: 'class sc_core::sc_port<sc_core::sc_fifo_out_if<int> >' has no member named 'write'In file included from testbench.cpp:7:0:head2.h: In member function 'void rrr::roperation()':head2.h:17:9: error: 'class sc_core::sc_port<sc_core::sc_fifo_in_if<int> >' has no member named 'read' below is the code: #include<systemc.h> #include"Head1.h" #include"Head2.h" int sc_main(int argc, char* argv[]) { sc_fifo<int> fifo(10); writer w("writer"); reader r("reader"); w.out(fifo); r.in(fifo); sc_start(-1); return 0; } //header1 #include<systemc.h> SC_MODULE(reader) { sc_port<sc_fifo_in_if<int> > in; void roperation() { int val; while (true) { wait(10, SC_NS) for (int i = 0; i <= 15; i++) { in.read(val); cout << val << endl; } } cout << "Availaible : " << in.num availaible() << endl; } SC_CTOR(writer) { SC_THREAD(woperation); } }; //header2 #include<systemc.h> SC_MODULE(writer) { sc_port<sc_fifo_out_if<int> > out; void woperation() { int val = 0; while (true) { wait(10, SC_NS); for (int i = 0; i <= 20; i++) { out.write(val++); } } } SC_CTOR(writer) { SC_THREAD(woperation); } };
  5. I'm trying to understand how to model a simple pass through module correctly. Let's say I've got 3 threads/modules A, B, and C such that A sends messages to B which forwards them to C (A --> B --> C). A naive approach for thread B: sc_fifo<Message> incoming_fifo("incoming", 3); sc_fifo<Message> outgoing_fifo("outgoing", 3); thread_A(){ while(true){ Message msg = new Message(); incoming_fifo.write(msg); } } thread_B(){ Message msg; while(true){ incoming_fifo.read(msg); outgoing_fifo.write(msg); } } thread_C(){} Further, let's say that module C is negligent and not reading from outgoing_fifo (sorry, the names are B-thread centric). One would naively assume that thread_A can send 6 messages (3 in each fifo) before the fifos become full and it's write becomes blocking. The problem is, thread_A can actually send 7 messages, because you essentially have an extra slot, conceptually, in thread_B between the success of its read and the block on its write. One solution might be to use tlm_fifos, first waiting on outgoing_fifo.ok_to_put() then blocking on incoming_fifo.get(). But this becomes problematic if for example there was another module also putting into outgoing_fifo --then ok_to_put() might be true at one point, but when the read/get from incoming_fifo awakens thread_B, it there might no longer be room in the outgoing_fifo. (A similar situation arises if you try to wait on ok_to_get(), but there are multiple threads pulling from incoming_fifo). Is there a way to solve this problem so that you can be sure that you don't pull from incoming_fifo if you don't have room in outgoing_fifo, ie. simultaneous condition checking, without resorting to something like polling?
  6. katang

    Searchable FIFO

    Is there a searchable FIFO implementation around? I mean: my Producers send their product to the FIFO of the Consumer when they like. The Consumer, however, might have a preference: may want to consume products of certain Producers first, independently of their position in the FIFO.
  7. I couldn't find a fifo that I can attached to socket. Are there any fifo available or do we have to create our own fifo? Thanks
  8. 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
  9. Hi All, I'm new at this forum. I encounter problem with circular_buffer. Let me explain it on simple example (code is from circular_buffer.h): I have a circular_buffer with few elements . After read one of them element is destroyed: template < typename T > T circular_buffer<T>::read() { T t = read_data(); buf_clear( m_buf, m_ri ); increment_read_pos(); return t; } template < typename T > inline void circular_buffer<T>::buf_clear( void* buf, int n ) { (static_cast<T*>(buf) + n)->~T(); } } // namespace tlm ... but In dectructor all elements are destroyed ... again template < typename T > circular_buffer<T>::~circular_buffer() { for( int i=0; i < used(); i++ ) { buf_clear( m_buf, i ); //!!!! } buf_free( m_buf ); } This case GPF's randomly. I notice that when I change desctructor code to for( int i=m_ri; i < used() % m_size; i++ ) { problem disappears I'm using SystemC 2.3.0 Is this a bug in TLM sources or I'm doing something wrong ? Radek
×