0

im looking 'risc-cpu' code which is in systemc library(specifically 'example' folder) but i can't understand what << operation in main.cpp is. in main.cpp they instantiate each module and do << operation with many sc_signal variable. i think it's something like binding operation but i want to know exactly.

below is some code from main.cpp

fetch   IFU("FETCH_BLOCK");      //instiate module fetch
    IFU.init_param(delay_cycles);  //module fetch delay for delay_cycles
    IFU << ram_dataout << branch_target_address << next_pc << branch_valid
        << stall_fetch << intreq << vectno << bios_valid << icache_valid
        << pred_fetch << pred_branch_address << pred_branch_valid << ram_cs << ram_we
        << addr << ram_datain << instruction << instruction_valid << program_counter
        << intack_cpu << branch_clear << pred_fetch_valid << reset << clk;

decode  IDU("DECODE_BLOCK");   //instanciate module decode as IDU
    IDU << reset << instruction << pred_instruction << instruction_valid
        << pred_inst_valid << out_valid << destout << dout << dram_dataout
        << dram_rd_valid << destout << fdout << fout_valid << fdestout
        << branch_clear << dsp_data_valid << program_counter << pred_on
        << branch_instruction_address << next_pc << branch_valid
        << branch_target_address << mem_access << mem_address << alu_op
        << mem_write << alu_src << reg_write << src_A << src_B << forward_A
        << forward_B << stall_fetch << decode_valid << float_valid << mmx_valid
        << pid_valid << pid_data << clk;
이승수
  • 9
  • 3
  • You need to find the header defining IFU and IDU and start looking for where the << operator overload is defined. I don't think this is standard systemc syntax. – Ifor Feb 19 '20 at 13:12
  • it's going to be something sensitivity related. – Ifor Feb 25 '20 at 10:56
  • 1
    thanks. as you said << operator was overloaded and it said it is used as positional binding. i still don't understand what positional binding is but thanks a lot!! – 이승수 Feb 26 '20 at 03:31

1 Answers1

0

<< is the standard left shift operator which in C++ is overloaded to also function as a put-to-stream. It appears to me they're simply writing a lot of values to IFU and IDU.

kthy
  • 827
  • 10
  • 27