@@ -8782,26 +8782,48 @@ void collect_clocks (RTLIL::Module* module,
8782
8782
case Technologies::GENESIS_3: {
8783
8783
#ifdef DEV_BUILD
8784
8784
run (" stat" );
8785
- #endif
8785
+ #endif
8786
+ // rs-dsp-multadd pass will infer multiplier as
8787
+ // 1. dsp_t1_20X1864_cfg_ports
8788
+ // 2. dsp_t1_10X9X32_cfg_params
8789
+ // All the parameters and Ports are configured to support multiply-add (MULTADD) functionality.
8790
+
8786
8791
if (new_dsp19x2) // RUN based on DSP19x2 mapping
8787
8792
run (" rs-dsp-multadd -genesis3 -new_dsp19x2 -max_dsp " + std::to_string (max_dsp));
8788
8793
else
8789
8794
run (" rs-dsp-multadd -genesis3 -max_dsp " + std::to_string (max_dsp));
8790
8795
8791
8796
DSP_COUNTER = DSP_COUNTER + Count_ADD;
8792
8797
run (" wreduce t:$mul" );
8798
+
8799
+ // rs-dsp-multacc pass will infer multiplier as
8800
+ // 1. dsp_t1_20X18X64_cfg_ports
8801
+ // 2. dsp_t1_10X9X32_cfg_params
8802
+ // All the parameters and Ports are configured to support multiply-accumulate (MULTACC) functionality.
8803
+
8793
8804
if (!new_dsp19x2)
8794
8805
run (" rs_dsp_macc" + use_dsp_cfg_params + genesis3 + " -max_dsp " + std::to_string (max_dsp));
8795
8806
else // RUN based on DSP19x2 mapping
8796
8807
run (" rs_dsp_macc" + use_dsp_cfg_params + genesis3 + " -new_dsp19x2" + " -max_dsp " + std::to_string (max_dsp));
8797
8808
8798
8809
check_dsp_device_limit ();
8799
8810
8800
- // Check if mult output is connected with Registers output
8811
+ // Check if the multiplier output is connected to a register input before decomposing large multipliers.
8812
+ // This function configures the parameters DSP_CLK, DSP_RESET_POL, REGOUT,
8813
+ // and DSP_RESET if the corresponding multiplier output Y is connected to a register input.
8814
+ // This information is later used during register packing stage of DSP inference.
8815
+
8801
8816
if (tech == Technologies::GENESIS_3)
8802
8817
check_mult_regout ();
8818
+
8819
+ // Process the large multiplier and decompose it into smaller multipliers optimized for RapidSilicon DSP.
8820
+ // The smaller multipliers are then mapped to the following cells.
8821
+ // \$__RS_MUL20X18
8822
+ // \$__RS_MUL10X9
8823
+
8803
8824
processDsp (cec);
8804
8825
8826
+ // map the processed \$__RS_MUL20X18 and \$__RS_MUL10X9 into dsp_t1_dsp_t1_20X18X64_cfg_ports and dsp_t1_10X9X32_cfg_params.
8805
8827
if (use_dsp_cfg_params.empty ())
8806
8828
run (" techmap -map " + dspMapFile + " -D USE_DSP_CFG_PARAMS=0" );
8807
8829
else
@@ -8827,12 +8849,18 @@ void collect_clocks (RTLIL::Module* module,
8827
8849
}
8828
8850
sec_check (" after_dsp_map4" , true , true );
8829
8851
8852
+ // pack the registers connected to the input and output of multipliers into DSP's
8830
8853
run (" rs-pack-dsp-regs -genesis3" );
8831
8854
8832
8855
// add register at the remaining decomposed small multiplier that are not packed in DSP cells
8833
8856
if (tech == Technologies::GENESIS_3)
8834
8857
add_out_reg ();
8835
8858
8859
+ // map the processed DSP cells into following cells based on the mode bits
8860
+ // RS_DSP_MULT ,RS_DSP_MULT_REGIN, RS_DSP_MULT_REGOUT, RS_DSP_MULT_REGIN_REGOUT
8861
+ // RS_DSP_MULTADD ,RS_DSP_MULTADD_REGIN, RS_DSP_MULTADD_REGOUT, RS_DSP_MULTADD_REGIN_REGOUT
8862
+ // RS_DSP_MULTACC ,RS_DSP_MULTACC_REGIN, RS_DSP_MULTACC_REGOUT, RS_DSP_MULTACC_REGIN_REGOUT
8863
+
8836
8864
run (" rs_dsp_io_regs -tech genesis3" );
8837
8865
8838
8866
if (cec) {
@@ -8842,7 +8870,8 @@ void collect_clocks (RTLIL::Module* module,
8842
8870
8843
8871
8844
8872
#if 1
8845
- // run("stat");
8873
+ run (" stat" );
8874
+ // finaly mapped above DSP mapped multiplier into DSP38 and DSP19X2
8846
8875
run (" techmap -map " + dsp38MapFile);
8847
8876
if (new_dsp19x2)
8848
8877
run (" techmap -map " + dsp19x2MapFile);
0 commit comments