Jump to content

Search the Community

Showing results for tags 'sc_module'.



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 Synthesizable Subset v1.4 Public Review
    • SystemC Verification (UVM-SystemC, SCV)
  • UVM (Universal Verification Methodology)
    • UVM 1.2 Public Review
    • Methodology and BCL Forum
    • UVM SystemVerilog Discussions
    • Simulator Specific Issues
    • UVM Commercial Announcements
  • 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

Calendars

  • Community Calendar

Found 4 results

  1. Hi, I have a simple project it's goal is to create a 32 bit ripple adder from an array of Full adders (FA). I have successfully implemented the FA (implementation attached) , but I have a simple problem now. Unlike the FA , the Ripple adder has many more inputs, and I cant find an efficient way to model these inputs , for instance in VHDL I would have an input port with the number of bits that I needed and I can access them easily in the architecture of the module, Unfortunatly this isn't the case for me in systemC. Approaches that I tried include: Using ( sc_in<sc_lv<32>> ) , which seems logical , but I cant deconstruct the vector into sc_logic inputs that I can then pass to my FA sub-modules to process. using ( sc_lv::read() ), doesn't seems to output the right data type (sc_logic) , I even tried type casting, but the constructor for the FA failed. Using array of sc_in<sc_logic> *A[32],*B[32]; , this approach is probably the closest I have got, It compiles correctly , but it doesn't run as there is always some kind of port that isn't connected correctly. Basically , I need to know how to model a 32 bit module and pass each individual bit to their respective sub-module. I know that there is the approach of declaring 32 inputs individually, but this seems tedious and the language must have some better approach. I realize this might seems easy, but I'm still new to systemC , and would love for someone to give me their feedback on how to implement this Ripple Adder as it would help me immensely in my project. FA.cpp FA.h HA.cpp HA.h
  2. Hi, I have a simple project it's goal is to create a 32 bit ripple adder from an array of Full adders (FA). I have successfully implemented the FA (implementation attached) , but I have a simple problem now. Unlike the FA , the Ripple adder has many more inputs, and I cant find an efficient way to model these inputs , for instance in VHDL I would have an input port with the number of bits that I needed and I can access them easily in the architecture of the module, Unfortunatly this isn't the case for me in systemC. Approaches that I tried include: Using ( sc_in<sc_lv<32>> ) , which seems logical , but I cant deconstruct the vector into sc_logic inputs that I can then pass to my FA sub-modules to process. using ( sc_lv::read() ), doesn't seems to output the right data type (sc_logic) , I even tried type casting, but the constructor for the FA failed. Using array of sc_in<sc_logic> *A[32],*B[32]; , this approach is probably the closest I have got, It compiles correctly , but it doesn't run as there is always some kind of port that isn't connected correctly. Basically , I need to know how to model a 32 bit module and pass each individual bit to their respective sub-module. I know that there is the approach of declaring 32 inputs individually, but this seems tedious and the language must have some better approach. I realize this might seems easy, but I'm still new to systemC , and would love for someone to give me their feedback on how to implement this Ripple Adder as it would help me immensely in my project. FA.cpp FA.h HA.cpp HA.h
  3. // Below is my chol.h header file #ifndef CHOL #define CHOL #define SC_INCLUDE_FX //#include "sc_module.h" #include "define.h" SC_MODULE (chol) { public: // Inputs sc_in_clk clk; sc_in<bool> rst; sc_in<sc_fixed<16,10, SC_TRN, SC_WRAP> > chol_in_data[3][3] ; // Output sc_out<sc_fixed<16,10, SC_TRN, SC_WRAP> > chol_out_data[3][3] ; /* F */ void chol_main ( void ); //sc_fixed<32,16, SC_TRN, SC_WRAP> cholesky(sc_fixed<32,16, SC_TRN, SC_WRAP> *); // Constructor SC_CTOR (chol) { SC_CTHREAD (chol_main, clk.pos() ); reset_signal_is(rst, false) ; sensitive << clk.pos(); } // Destructor ~chol() {} }; #endif /// Below is my cholesky.cpp file #include "chol.h" #include <math.h> //Main Thread void chol::chol_main () { // Variable declaration sc_fixed<16,10, SC_TRN, SC_WRAP> chol_output[3][3]; sc_fixed<16,10, SC_TRN, SC_WRAP> chol_in[3][3]; int n=3; // Reset cycle// //chol_output.write(0); //wait(); //Main Thread while (true) { for (int i=0; i<n; i++) { for(int j=0; j<=i; j++) { chol_in[j] = chol_in_data[j].read(); } } } for (int i=0; i<n; i++) { for (int j=0; j<=i; j++) { sc_fixed<16,10, SC_TRN, SC_WRAP> sum = 0; for (int k=0; k<j; k++) { sum += chol_output[k] * chol_output[j][k]; } if (i==j) { chol_output = sqrt(chol_in - sum) ; } else { chol_ouput[j] = 1.0 / chol_ouput[j][j] * (chol_in[j] - sum); } } } // Cholesky Function //chol_output = cholesky (chol_in); chol_out_data.write(chol_output); } when i try to compile this file i get the follwoing errors. output: g++ -O1 -I"/home/mahesh/systemc/systemc-2.3.1a/include" -I"." -c cholesky.cpp -o cholesky.o cholesky.cpp: In member function ‘void chol::chol_main()’: cholesky.cpp:46:5: error: ‘chol_ouput’ was not declared in this scope chol_ouput[j] = 1.0 / chol_ouput[j][j] * (chol_in[j] - sum); ^ cholesky.cpp:53:17: error: request for member ‘write’ in ‘((chol*)this)->chol::chol_out_data’, which is of non-class type ‘sc_core::sc_out<sc_dt::sc_fixed<16, 10, (sc_dt::sc_q_mode)5u, (sc_dt::sc_o_mode)3u> > [3][3]’ chol_out_data.write(chol_output); ^ Makefile:90: recipe for target 'cholesky.o' failed make: *** [cholesky.o] Error 1 It would be very helpful if someone could resolve this error for me. I tried working on alternatives but I am not able to handle my issue. Thanks in advance.
  4. Hello, I am trying to create several nodes that are represented as SC_MODULE. I see that once I reach 10000 nodes the compile throws the following error: SG_m_n: ../../../../src/sysc/kernel/sc_cor_qt.cpp:107: virtual void sc_core::sc_cor_qt::stack_protect(bool): Assertion `ret == 0' failed. Aborted (core dumped) I think it might be related to memory protection (mprotect()) but I don't know if someone has some ideas about this limitation or how to overcome it? thank you :), Emad
×