Jump to content

Search the Community

Showing results for tags 'sc_fifo systemC tlm'.



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)
    • SystemC Datatypes
  • 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 1.0
    • Portable Stimulus Pre-Release Discussion
  • IP Security
    • IP Security Assurance Whitepaper Discussion
  • IP-XACT
    • IP-XACT Discussion
  • IEEE 1735/IP Encryption
    • IEEE 1735/IP Encryption Discussion
  • 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 1 result

  1. Hi everybody. I'm try to develop some project and met with problem. My project is very simple: 2 Blocks has not duplex connection. (Block1 -> Block2). Block1 generating some data and send it to Block2. In fact, in behavioral code block2 have line while(in_port_1009->num_available()); { // do something } i.e. he should wait some data in buffer. But I'm wrote some dbg line to check: wait my block some data or not. while(in_port_1009->num_available()); { cout << sc_time_stamp() << " Im insinde obj 1: "<< endl; //Do something }; This is code of Block1 (tranciever) void process_thread() { int res = 0; data_1004to1009 outMessage1004; while(true) { res = gen_data(); itoa(res, outMessage1004.data, 10); wait(7, SC_NS); // <- block2 go inside to the loop, when I'm do this line, //i.e. data not sended yet out_port_1004->write(outMessage1004); } } You can ask me why I'm use classes like a type of data for links. Answer: this is conditions of project. Please, someone, help me ASAP. Here attached code: main.cpp #include <iostream> #include <fstream> using namespace std; class data_1004to1009 { public: char data[8]; data_1004to1009() { memset(data, 0, sizeof(data)); } inline friend ostream& operator << ( ostream& os, data_1004to1009_t const & v ) { os << "(" << v.data << "," << std::boolalpha << "," << v.data << ")"; return os; } }; #include "peObj0.h" #include "peObj1.h" int sc_main(int argc, char* argv[]) { peObj0 peObj0Component("peObj0"); peObj1 peObj1Component("peObj1"); sc_fifo<data_1004to1009_t> fifoBufferPort1004toPort1009(1); peObj1Component.in_port_1009(fifoBufferPort1004toPort1009); peObj0Component.out_port_1004(fifoBufferPort1004toPort1009); sc_start(150, SC_NS); sc_stop(); getchar(); return 0; } pe0Obj.h #include <iostream> #include <systemc.h> SC_MODULE(peObj0) { //Ports declaration sc_port<sc_fifo_out_if<data_1004to1009> > out_port_1004; void process_thread() { int res = 0; data_1004to1009 outMessage1004; while(true) { res = rand()%10; out_busy.write(0); itoa(res, outMessage1004.data, 10); wait(7, SC_NS); out_port_1004->write(outMessage1004); } } SC_CTOR(peObj0) { SC_THREAD(process_thread); }; }; peObj1.h #include <iostream> #include <systemc.h> SC_MODULE(peObj1) { sc_port<sc_fifo_in_if<data_1004to1009> > in_port_1009; void process_thread() { int in_dataValue1009 = 0; int res = 0; data_1004to1009 inMessage1009; while(true) { out_busy.write(0); out_working.write(0); while(in_port_1009->num_available()); { cout << sc_time_stamp() << " Im insinde obj 1: "<< endl; in_port_1009->read(inMessage1009); in_dataValue1009 = atoi(inMessage1009.data); wait(6, SC_NS); cout << sc_time_stamp() << " peObj1 recieved data: "<< in_dataValue1009 << endl; } } } SC_CTOR(peObj1) { SC_THREAD(process_thread); }; }; I HAVE TROUBLE WITH FILE UPLOADING. SORRY
×
×
  • Create New...