Jump to content

Aaron Yang

  • Content Count

  • Joined

  • Last visited

About Aaron Yang

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hey guys, Need help about this: Exception thrown at 0x00007FFC1FCE1CAF (ntdll.dll) in mytest.exe: 0xC0000005: Access violation reading location 0x0000000000000000. I traced the call stack to where it stopped in my code, found it's this line in header file: sc_vector<sc_signal<float>> output_connect_wire{"output_connect_wire",1}; It's been used like this in cpp file, not sure if it's relevant though: .... submodule->O_data(output_connect_wire); .... if(...){...} else { data_out.write(output_conncet_wire[0].read()); } .... where the submodule output declared as sc_vector<sc_out<float>> O_data{"O_data",1}; Thank you in advance and tell me if you need any more info to identify the issue.
  2. Aaron Yang

    Sensitive List

    Thank you for the explanation, where should I put this overload? In the systemc.h?
  3. Aaron Yang

    Sensitive List

    To be more concrete, I have another thread called fir_main and in_val = din.read(); In this example, I want to trigger fir_comb by adding the in_val(updated in the fir_main) to its sensitive list.
  4. Aaron Yang

    Sensitive List

    Hey, question about the sensitive list, I got this error: fir.h:79:23: error: no match for 'operator<<' (operand types are 'sc_core::sc_sensitive' and 'sc_core::sc_vector<sc_dt::sc_fixed<16, 2> >::element_type {aka sc_dt::sc_fixed<16, 2>}') sensitive << in_val; Here is the fir.h sc_vector<sc_fixed<din_size, din_int>> in_val{"in_val", din_num_samples}; void fir_comb(); SC_HAS_PROCESS(fir); // The combination of SC_HAS_PROCESS and a normal constructor replaces the use of SC_CTOR fir(sc_module_name name_, bool debug_ = false): sc_module(name_), debug(debug_) { SC_THREAD(fir_comb); for( unsigned i= 0; i<in_val.size(); ++i ) sensitive << in_val[i]; Anything wrong with it? Thank you in advance.
  5. Aaron Yang

    How to connect array of ports?

    Thanks Roman, that works!
  6. Hey I am kinda new to system C, I met this error when connecting ports declared as array: sc_main.cpp: In function 'int sc_main(int, char**)': sc_main.cpp:16:21: error: expression cannot be used as a function tb0.in(sample_in); This is sc_main.cpp #include <systemc.h> #include "fir.h" #include "tb.h" int sc_main (int, char *[]){ sc_clock clock("clock", 10, SC_NS); sc_signal<bool> reset; sc_signal<sc_fixed<16,2>> sample_in[2]; sc_signal<sc_fixed<16,2>> sample_out[4]; tb tb0("tb0_name"); tb0.rstn(reset); tb0.clk(clock); tb0.in(sample_in); tb0.out(sample_out); fir1("fir1_name", true); fir1.din(sample_in); fir1.dout(sample_out); This is the tb.h file #include <systemc.h> SC_MODULE(tb) { sc_in<bool> clk; sc_out<bool> rstn; sc_out<sc_fixed<16,2>> in[2]; sc_in<sc_fixed<16,2>> out[4]; This is the fir.h #include <systemc.h> SC_MODULE(fir) { sc_in<bool> rst_n; sc_in<bool> clk; sc_in<sc_fixed<16,2>> din[2]; sc_out<sc_fixed<16,2>> dout[4]; What should I do in this case?