├── .gitattributes ├── CMakeLists.txt ├── DataPathPromotion.cpp ├── DatapathCodehMotion.cpp ├── DeadMemOpElimination.cpp ├── FixMachineCode.cpp ├── FixTerminators.cpp ├── HyperBlockFormation.cpp ├── LLVMBuild.txt ├── MCTargetDesc ├── CMakeLists.txt ├── LLVMBuild.txt └── VerilogBackendMCTargetDesc.cpp ├── MachineBasicBlockTopOrder.cpp ├── MemOpsFusing.cpp ├── README.md ├── ScriptingPass.cpp ├── VFInfo.cpp ├── VFrameLowering.cpp ├── VFrameLowering.h ├── VISelDAGToDAG.cpp ├── VISelLowering.cpp ├── VInstrFormats.td ├── VInstrInfo.cpp ├── VInstrInfo.td ├── VIntrinsics.td ├── VIntrinsicsInfo.cpp ├── VIntrinsicsInfo.h ├── VRegisterInfo.cpp ├── VRegisterInfo.td ├── VSelectionDAGInfo.cpp ├── VSelectionDAGInfo.h ├── VTM.td ├── VTargetMachine.cpp ├── VTargetMachine.h ├── cmake ├── FindABC.cmake ├── FindBOOST.cmake ├── FindLpSolve.cmake ├── FindLua.cmake └── FindLuaBind.cmake ├── include ├── CMakeLists.txt └── vtm │ ├── CMakeLists.txt │ ├── DesignMetrics.h │ ├── DetailLatencyInfo.h │ ├── FUInfo.h │ ├── LangSteam.h │ ├── LuaScript.h │ ├── Passes.h │ ├── SynSettings.h │ ├── Utilities.h │ ├── VFInfo.h │ ├── VISelLowering.h │ ├── VInstrInfo.h │ ├── VRegisterInfo.h │ ├── VerilogAST.h │ ├── VerilogBackendMCTargetDesc.h │ └── VerilogModuleAnalysis.h ├── lib ├── BitLevelOpt │ ├── BitLevelInfo.cpp │ ├── BitLevelOpt.cpp │ ├── CMakeLists.txt │ ├── LLVMBuild.txt │ └── LogicSynthesis │ │ └── LogicSynthesis.cpp ├── CMakeLists.txt ├── HighLevelOpt │ ├── CMakeLists.txt │ ├── FunctionFilter.cpp │ ├── HLSInliner.cpp │ ├── LLVMBuild.txt │ └── TrivialLoopUnrollPass.cpp ├── LLVMBuild.txt ├── RTLCodegen │ ├── CMakeLists.txt │ ├── CombPathDelayAnalysis.cpp │ ├── ControlLogicBuilder.cpp │ ├── DesignMetrics.cpp │ ├── IR2Datapath.cpp │ ├── IR2Datapath.h │ ├── LLVMBuild.txt │ ├── MachineFunction2Datapath.cpp │ ├── MachineFunction2Datapath.h │ ├── PreSchedRTLOpt.cpp │ ├── RTLCodegenPrepare.cpp │ ├── RtlSSAAnalysis.cpp │ ├── RtlSSAAnalysis.h │ ├── VASTExprBuilder.cpp │ ├── VASTExprBuilder.h │ ├── VerilogASTBuilder.cpp │ ├── VerilogASTWriter.cpp │ └── VerilogModuleAnalysis.cpp ├── Schedule │ ├── AdjustLIForBundles.cpp │ ├── CMakeLists.txt │ ├── ChainBreakingAnalysis.cpp │ ├── ChainBreakingAnalysis.h │ ├── CompGraph.cpp │ ├── CompGraph.h │ ├── CompGraphDOT.h │ ├── CompGraphTraits.h │ ├── DetailLatencyInfo.cpp │ ├── LLVMBuild.txt │ ├── MuxPrebinding.h │ ├── PrebindMuxBase.cpp │ ├── RecurrenceFinder.cpp │ ├── SDCScheduler.cpp │ ├── ScheduleDOT.h │ ├── ScheduleEmitter.cpp │ ├── Schedulers.cpp │ ├── SchedulingBase.cpp │ ├── SchedulingBase.h │ ├── UnbalanceMuxPrebind.cpp │ ├── VAliasAnalysis.cpp │ ├── VPreRegAllocSched.cpp │ ├── VRegAllocSimple.cpp │ ├── VSUnit.cpp │ └── VSUnit.h └── Scripting │ ├── BindingTraits.h │ ├── CMakeLists.txt │ ├── FUInfo.cpp │ ├── LLVMBuild.txt │ ├── LuaScript.cpp │ ├── VerilogAST.cpp │ ├── lua2c.lua │ └── luapp.lua ├── testsuite ├── AccumulateStats.py ├── AddModules.lua ├── AlteraCommon.lua ├── BramGlobVar.lua ├── BramMIFGen.lua ├── CMakeLists.txt ├── EP2C35F672C6.lua ├── EP2C70F896C6.lua ├── EP4CE115F29I8L.lua ├── EP4CE75F29C6.lua ├── ExpectFails ├── FixFailList.sh ├── FuncDefine.lua ├── InterfaceGen.lua ├── Loops │ ├── CMakeLists.txt │ ├── cfg_loop.cpp │ ├── cfg_loop_pipe.cpp │ ├── cfg_loop_popcnt.cpp │ ├── cfg_loop_sum.cpp │ ├── cfg_loop_two_array.cpp │ ├── cfg_loop_vb.cpp │ └── loop_memop_fusing_mem_move_8bit.cpp ├── ModelSimGen.lua ├── SCIfCodegen.lua ├── SimpleTest │ ├── CMakeLists.txt │ ├── GV_promotion.cpp │ ├── cfg_if.cpp │ ├── cfg_if_else.cpp │ ├── cfg_nested_if_else.cpp │ ├── fu_bram.cpp │ ├── fu_bram_continuous_load.cpp │ ├── implicit_global_code_motion_delay_insertion_0.cpp │ ├── mem_unalign.cpp │ ├── memdep_alias.cpp │ ├── memdep_noalias.cpp │ ├── op_add.cpp │ ├── op_asr.cpp │ ├── op_continuous_ldint8.cpp │ ├── op_div.cpp │ ├── op_eq.cpp │ ├── op_ldint16.cpp │ ├── op_ldint32.cpp │ ├── op_ldint64.cpp │ ├── op_ldint8.cpp │ ├── op_lduint16.cpp │ ├── op_lduint32.cpp │ ├── op_lduint64.cpp │ ├── op_lduint8.cpp │ ├── op_lsr.cpp │ ├── op_mult.cpp │ ├── op_mult_folding.cpp │ ├── op_ne.cpp │ ├── op_or.cpp │ ├── op_sel.cpp │ ├── op_sge.cpp │ ├── op_sgt.cpp │ ├── op_shift.cpp │ ├── op_shl.cpp │ ├── op_sle.cpp │ ├── op_slt.cpp │ ├── op_stint16.cpp │ ├── op_stint32.cpp │ ├── op_stint64.cpp │ ├── op_stint8.cpp │ ├── op_stuint16.cpp │ ├── op_stuint32.cpp │ ├── op_stuint64.cpp │ ├── op_stuint8.cpp │ ├── op_sub.cpp │ ├── op_uge.cpp │ ├── op_ugt.cpp │ ├── op_ule.cpp │ ├── op_ult.cpp │ ├── schedule_fu_conflict.cpp │ ├── sim_memcpy.cpp │ ├── sim_memcpy_complex.cpp │ ├── sim_memcpy_libcall_opt.cpp │ ├── sim_memmove.cpp │ ├── sim_memset.cpp │ ├── sim_memset_complex.cpp │ └── sub_module_non_memory_access.cpp ├── StatsCycles.py ├── StatsSynthesis.py ├── VLTIfCodegen.lua ├── benchmark │ ├── CMakeLists.txt │ ├── ChStone │ │ ├── CMakeLists.txt │ │ ├── adpcm │ │ │ ├── CMakeLists.txt │ │ │ ├── adpcm_main.cpp │ │ │ └── encode.cpp │ │ ├── aes │ │ │ ├── CMakeLists.txt │ │ │ ├── InversShiftRow_ByteSub.cpp │ │ │ ├── aes_main.cpp │ │ │ ├── decrypt.cpp │ │ │ ├── encrypt.cpp │ │ │ └── include │ │ │ │ ├── aes.h │ │ │ │ ├── aes_dec.cpp │ │ │ │ ├── aes_enc.cpp │ │ │ │ ├── aes_func.cpp │ │ │ │ └── aes_key.cpp │ │ ├── blowfish │ │ │ ├── BF_cfb64_encrypt.cpp │ │ │ ├── BF_encrypt.cpp │ │ │ ├── BF_set_key.cpp │ │ │ ├── CMakeLists.txt │ │ │ ├── blowfish_main.cpp │ │ │ └── include │ │ │ │ ├── bf_cfb64.c │ │ │ │ ├── bf_enc.c │ │ │ │ ├── bf_locl.h │ │ │ │ ├── bf_pi.h │ │ │ │ ├── bf_skey.c │ │ │ │ └── blowfish.h │ │ ├── dfadd │ │ │ ├── CMakeLists.txt │ │ │ ├── addFloat64Sigs.cpp │ │ │ ├── float64_add.cpp │ │ │ ├── include │ │ │ │ ├── SPARC-GCC.h │ │ │ │ ├── milieu.h │ │ │ │ ├── softfloat-macros │ │ │ │ ├── softfloat-specialize │ │ │ │ ├── softfloat.c │ │ │ │ └── softfloat.h │ │ │ ├── roundAndPackFloat64.cpp │ │ │ └── subFloat64Sigs.cpp │ │ ├── dfdiv │ │ │ ├── CMakeLists.txt │ │ │ ├── float64_div.cpp │ │ │ └── include │ │ │ │ ├── SPARC-GCC.h │ │ │ │ ├── dfdiv.c │ │ │ │ ├── milieu.h │ │ │ │ ├── softfloat-macros │ │ │ │ ├── softfloat-specialize │ │ │ │ ├── softfloat.c │ │ │ │ └── softfloat.h │ │ ├── dfmul │ │ │ ├── CMakeLists.txt │ │ │ ├── float64_mul.cpp │ │ │ └── include │ │ │ │ ├── SPARC-GCC.h │ │ │ │ ├── dfmul.c │ │ │ │ ├── milieu.h │ │ │ │ ├── softfloat-macros │ │ │ │ ├── softfloat-specialize │ │ │ │ ├── softfloat.c │ │ │ │ └── softfloat.h │ │ ├── dfsin │ │ │ ├── CMakeLists.txt │ │ │ ├── include │ │ │ │ ├── SPARC-GCC.h │ │ │ │ ├── dfsin.c │ │ │ │ ├── milieu.h │ │ │ │ ├── softfloat-macros │ │ │ │ ├── softfloat-specialize │ │ │ │ ├── softfloat.cpp │ │ │ │ └── softfloat.h │ │ │ └── sin.cpp │ │ ├── gsm │ │ │ ├── Autocorrelation.cpp │ │ │ ├── CMakeLists.txt │ │ │ ├── Gsm_LPC_Analysis.cpp │ │ │ ├── Quantization_and_coding.cpp │ │ │ ├── Reflection_coefficients.cpp │ │ │ ├── Transformation_to_Log_Area_Ratios.cpp │ │ │ └── include │ │ │ │ ├── add.cpp │ │ │ │ ├── lpc.cpp │ │ │ │ └── private.h │ │ ├── jpeg │ │ │ ├── BoundIDctMatrix.cpp │ │ │ ├── CMakeLists.txt │ │ │ ├── ChenIDct.cpp │ │ │ ├── DecodeHuffMCU.cpp │ │ │ ├── DecodeHuffman.cpp │ │ │ ├── IQuantize.cpp │ │ │ ├── IZigzagMatrix.cpp │ │ │ ├── PostshiftIDctMatrix.cpp │ │ │ ├── decode_block.cpp │ │ │ ├── decode_start.cpp │ │ │ ├── get_dqt.cpp │ │ │ ├── huff_make_dhuff_tb.cpp │ │ │ ├── include │ │ │ │ ├── chenidct.cpp │ │ │ │ ├── decode.cpp │ │ │ │ ├── decode.h │ │ │ │ ├── global.h │ │ │ │ ├── huffman.cpp │ │ │ │ ├── huffman.h │ │ │ │ ├── init.h │ │ │ │ ├── jfif_read.cpp │ │ │ │ ├── jpeg2bmp.cpp │ │ │ │ └── marker.cpp │ │ │ ├── jpeg2bmp_main.cpp │ │ │ ├── jpeg_init_decompress.cpp │ │ │ ├── jpeg_read.cpp │ │ │ └── read_markers.cpp │ │ ├── mips │ │ │ ├── CMakeLists.txt │ │ │ ├── imem.h │ │ │ └── mips.cpp │ │ ├── motion │ │ │ ├── CMakeLists.txt │ │ │ ├── Initialize_Buffer.cpp │ │ │ ├── include │ │ │ │ ├── config.h │ │ │ │ ├── getbits.cpp │ │ │ │ ├── getvlc.cpp │ │ │ │ ├── getvlc.h │ │ │ │ ├── global.h │ │ │ │ ├── motion.cpp │ │ │ │ └── mpeg2dec.h │ │ │ └── motion_vectors.cpp │ │ └── sha │ │ │ ├── CMakeLists.txt │ │ │ ├── include │ │ │ ├── sha.cpp │ │ │ └── sha.h │ │ │ ├── sha_stream.cpp │ │ │ └── sha_transform.cpp │ ├── DSPStone │ │ ├── CMakeLists.txt │ │ ├── adpcm │ │ │ ├── ad21 │ │ │ │ ├── Makefile │ │ │ │ ├── Makefile.tex │ │ │ │ ├── adsp2101.ach │ │ │ │ ├── adsp2101.sys │ │ │ │ ├── adsp2101.sys.tex │ │ │ │ ├── adsp2101.win │ │ │ │ ├── board_test.c │ │ │ │ ├── board_test.c.tex │ │ │ │ ├── board_test.cde │ │ │ │ ├── board_test.exe │ │ │ │ ├── board_test.int │ │ │ │ ├── board_test.map │ │ │ │ ├── board_test.obj │ │ │ │ ├── board_test.s │ │ │ │ ├── board_test.sym │ │ │ │ ├── g721.c │ │ │ │ ├── g721.c.tex │ │ │ │ ├── g721.h │ │ │ │ ├── g721.h.tex │ │ │ │ ├── portab.h │ │ │ │ ├── portab.h.tex │ │ │ │ ├── report.aux │ │ │ │ ├── report.dvi │ │ │ │ ├── report.log │ │ │ │ ├── report.ps │ │ │ │ ├── report.tex │ │ │ │ ├── verify.c │ │ │ │ ├── verify.map │ │ │ │ └── verify.sym │ │ │ ├── adpcm_c_nl │ │ │ │ ├── Makefile │ │ │ │ ├── README │ │ │ │ ├── adpcm.2 │ │ │ │ ├── adpcm.c │ │ │ │ ├── adpcm.h │ │ │ │ ├── adpcm.o │ │ │ │ ├── adpcm.shar │ │ │ │ ├── hello.adpcm.uu │ │ │ │ ├── libst.h │ │ │ │ ├── rawcaudio │ │ │ │ ├── rawcaudio.c │ │ │ │ ├── rawcaudio.o │ │ │ │ ├── rawdaudio │ │ │ │ ├── rawdaudio.c │ │ │ │ ├── rawdaudio.o │ │ │ │ ├── sgicaudio.c │ │ │ │ ├── sgidaudio.c │ │ │ │ ├── suncaudio.c │ │ │ │ ├── timing │ │ │ │ ├── timing.c │ │ │ │ └── timing.o │ │ │ ├── board_test.c │ │ │ ├── board_test.c.tex │ │ │ ├── c50 │ │ │ │ ├── Makefile │ │ │ │ ├── Makefile.asm.tex │ │ │ │ ├── Makefile.tex │ │ │ │ ├── asm.cfg │ │ │ │ ├── board_test.asm │ │ │ │ ├── board_test.c │ │ │ │ ├── board_test.c.tex │ │ │ │ ├── board_test.cmd │ │ │ │ ├── board_test.exe │ │ │ │ ├── board_test.lst │ │ │ │ ├── board_test.map │ │ │ │ ├── board_test.obj │ │ │ │ ├── g721.asm │ │ │ │ ├── g721.c │ │ │ │ ├── g721.c.tex │ │ │ │ ├── g721.h │ │ │ │ ├── g721.h.tex │ │ │ │ ├── portab.h │ │ │ │ ├── portab.h.tex │ │ │ │ ├── report.aux │ │ │ │ ├── report.dvi │ │ │ │ ├── report.log │ │ │ │ ├── report.ps │ │ │ │ ├── report.tex │ │ │ │ ├── siminit.cmd │ │ │ │ └── verify.c │ │ │ ├── dsp561 │ │ │ │ ├── adpcm.asm │ │ │ │ ├── adpcm.hlp │ │ │ │ ├── adpcmd.asm │ │ │ │ └── adpcme.asm │ │ │ ├── dsp56k │ │ │ │ ├── Makefile │ │ │ │ ├── Makefile.tex │ │ │ │ ├── adpcm.asm │ │ │ │ ├── adpcm.hlp │ │ │ │ ├── adpcm.prof │ │ │ │ ├── board_test.c │ │ │ │ ├── board_test.c.tex │ │ │ │ ├── board_test.cld │ │ │ │ ├── board_test.cln │ │ │ │ ├── g721.c │ │ │ │ ├── g721.c.tex │ │ │ │ ├── g721.cln │ │ │ │ ├── g721.h │ │ │ │ ├── g721.h.tex │ │ │ │ ├── mocad.H │ │ │ │ ├── mocad.H.tex │ │ │ │ ├── portab.h │ │ │ │ ├── portab.h.tex │ │ │ │ ├── report.aux │ │ │ │ ├── report.dvi │ │ │ │ ├── report.log │ │ │ │ ├── report.ps │ │ │ │ ├── report.tex │ │ │ │ └── verify.c │ │ │ ├── g721.c │ │ │ ├── g721.c.tex │ │ │ ├── g721.h │ │ │ ├── g721.h.tex │ │ │ ├── g721 │ │ │ │ ├── DSP56k │ │ │ │ │ ├── Makefile │ │ │ │ │ ├── SCCS │ │ │ │ │ │ ├── p.Makefile │ │ │ │ │ │ ├── p.board_test.c │ │ │ │ │ │ ├── s.Makefile │ │ │ │ │ │ └── s.board_test.c │ │ │ │ │ ├── board_test.c │ │ │ │ │ ├── g721.c │ │ │ │ │ ├── g721.h │ │ │ │ │ ├── portab.h │ │ │ │ │ └── verify.c │ │ │ │ ├── Makefile │ │ │ │ ├── SCCS │ │ │ │ │ ├── p.portab.h │ │ │ │ │ ├── s.Makefile │ │ │ │ │ ├── s.g721.c │ │ │ │ │ ├── s.g721.h │ │ │ │ │ ├── s.itu_decoder.c │ │ │ │ │ ├── s.itu_decoder.proj │ │ │ │ │ ├── s.itu_encoder.c │ │ │ │ │ ├── s.itu_encoder.proj │ │ │ │ │ ├── s.mocad.H │ │ │ │ │ └── s.portab.h │ │ │ │ ├── g721.c │ │ │ │ ├── g721.h │ │ │ │ ├── itu_decoder.c │ │ │ │ ├── itu_decoder.proj │ │ │ │ ├── itu_encoder.c │ │ │ │ ├── itu_encoder.proj │ │ │ │ ├── mocad.H │ │ │ │ ├── portab.h │ │ │ │ └── test_seq │ │ │ │ │ ├── A_LAW_homing │ │ │ │ │ ├── hi32fa.o │ │ │ │ │ ├── hn32fa.i │ │ │ │ │ ├── hn32fa.o │ │ │ │ │ ├── hn32fx.o │ │ │ │ │ ├── hv32fa.i │ │ │ │ │ ├── hv32fa.o │ │ │ │ │ ├── hv32fx.o │ │ │ │ │ ├── i_ini_32.a │ │ │ │ │ ├── nrm.a │ │ │ │ │ └── pcm_init.a │ │ │ │ │ ├── A_LAW_reset │ │ │ │ │ ├── i32 │ │ │ │ │ ├── nrm.a │ │ │ │ │ ├── ovr.a │ │ │ │ │ ├── read.me │ │ │ │ │ ├── ri32fa.o │ │ │ │ │ ├── rn32fa.i │ │ │ │ │ ├── rn32fa.o │ │ │ │ │ ├── rn32fx.o │ │ │ │ │ ├── rv32fa.i │ │ │ │ │ ├── rv32fa.o │ │ │ │ │ └── rv32fx.o │ │ │ │ │ ├── u_LAW_homing │ │ │ │ │ ├── hi32fm.o │ │ │ │ │ ├── hn32fc.o │ │ │ │ │ ├── hn32fm.i │ │ │ │ │ ├── hn32fm.o │ │ │ │ │ ├── hv32fc.o │ │ │ │ │ ├── hv32fm.i │ │ │ │ │ ├── hv32fm.o │ │ │ │ │ ├── i32 │ │ │ │ │ ├── i_ini_32.m │ │ │ │ │ ├── nrm.m │ │ │ │ │ ├── ovr.m │ │ │ │ │ ├── pcm_init.m │ │ │ │ │ └── read.me │ │ │ │ │ └── u_LAW_reset │ │ │ │ │ ├── i32 │ │ │ │ │ ├── nrm.m │ │ │ │ │ ├── ovr.m │ │ │ │ │ ├── read.me │ │ │ │ │ ├── ri32fm.o │ │ │ │ │ ├── rn32fc.o │ │ │ │ │ ├── rn32fm.i │ │ │ │ │ ├── rn32fm.o │ │ │ │ │ ├── rv32fc.o │ │ │ │ │ ├── rv32fm.i │ │ │ │ │ └── rv32fm.o │ │ │ ├── is2_fix_adpcm │ │ │ │ ├── README │ │ │ │ ├── mnemonic_count │ │ │ │ │ ├── Makefile │ │ │ │ │ ├── adpcm-grp1-distr.ps │ │ │ │ │ ├── adpcm-grp1.xg │ │ │ │ │ ├── adpcm-mnecount.ps │ │ │ │ │ ├── adpcm.asm │ │ │ │ │ ├── adpcm.imc.ps │ │ │ │ │ ├── adpcm.imc.xg │ │ │ │ │ ├── adpcm.inf │ │ │ │ │ ├── adpcm.lst │ │ │ │ │ ├── adpcm.mmc.ps │ │ │ │ │ ├── adpcm.mmc.xg │ │ │ │ │ ├── adpcm.mvc │ │ │ │ │ ├── adpcm.rmc.ps │ │ │ │ │ ├── adpcm.rmc.xg │ │ │ │ │ ├── adpcm.tfc │ │ │ │ │ ├── adpcm.xg │ │ │ │ │ ├── ccsim │ │ │ │ │ ├── compile │ │ │ │ │ ├── compile.all │ │ │ │ │ ├── data.in │ │ │ │ │ ├── data.out │ │ │ │ │ ├── data_in.c │ │ │ │ │ ├── doit │ │ │ │ │ ├── fixopt_adpcm.bd │ │ │ │ │ ├── fixopt_adpcm.c │ │ │ │ │ ├── fixopt_adpcm.h │ │ │ │ │ ├── loopstruct.tex │ │ │ │ │ ├── opt-adpcm-v1-mnecount.ps │ │ │ │ │ ├── opt-adpcm-v1.rmc.ps │ │ │ │ │ ├── opt_adpcm-v1-grp1-distr.ps │ │ │ │ │ ├── opt_adpcm-v1-grp1.xg │ │ │ │ │ ├── opt_adpcm-v1.asm │ │ │ │ │ ├── opt_adpcm-v1.c │ │ │ │ │ ├── opt_adpcm-v1.imc.ps │ │ │ │ │ ├── opt_adpcm-v1.imc.xg │ │ │ │ │ ├── opt_adpcm-v1.inf │ │ │ │ │ ├── opt_adpcm-v1.lst │ │ │ │ │ ├── opt_adpcm-v1.mmc.ps │ │ │ │ │ ├── opt_adpcm-v1.mmc.xg │ │ │ │ │ ├── opt_adpcm-v1.mvc │ │ │ │ │ ├── opt_adpcm-v1.rmc.ps │ │ │ │ │ ├── opt_adpcm-v1.rmc.xg │ │ │ │ │ ├── opt_adpcm-v1.sim │ │ │ │ │ ├── opt_adpcm-v1.tfc │ │ │ │ │ ├── opt_adpcm-v1.xg │ │ │ │ │ ├── opt_adpcm-v2-grp1-distr.ps │ │ │ │ │ ├── opt_adpcm-v2-grp1.xg │ │ │ │ │ ├── opt_adpcm-v2-mnecount.ps │ │ │ │ │ ├── opt_adpcm-v2.asm │ │ │ │ │ ├── opt_adpcm-v2.c │ │ │ │ │ ├── opt_adpcm-v2.imc.ps │ │ │ │ │ ├── opt_adpcm-v2.imc.xg │ │ │ │ │ ├── opt_adpcm-v2.inf │ │ │ │ │ ├── opt_adpcm-v2.lst │ │ │ │ │ ├── opt_adpcm-v2.mmc.ps │ │ │ │ │ ├── opt_adpcm-v2.mmc.xg │ │ │ │ │ ├── opt_adpcm-v2.mvc │ │ │ │ │ ├── opt_adpcm-v2.rmc.ps │ │ │ │ │ ├── opt_adpcm-v2.rmc.xg │ │ │ │ │ ├── opt_adpcm-v2.sim │ │ │ │ │ ├── opt_adpcm-v2.tfc │ │ │ │ │ ├── opt_adpcm-v2.xg │ │ │ │ │ ├── opt_adpcm-v3-grp1-distr.ps │ │ │ │ │ ├── opt_adpcm-v3-grp1.xg │ │ │ │ │ ├── opt_adpcm-v3-mnecount.ps │ │ │ │ │ ├── opt_adpcm-v3.asm │ │ │ │ │ ├── opt_adpcm-v3.c │ │ │ │ │ ├── opt_adpcm-v3.imc.ps │ │ │ │ │ ├── opt_adpcm-v3.imc.xg │ │ │ │ │ ├── opt_adpcm-v3.inf │ │ │ │ │ ├── opt_adpcm-v3.lst │ │ │ │ │ ├── opt_adpcm-v3.mmc.ps │ │ │ │ │ ├── opt_adpcm-v3.mmc.xg │ │ │ │ │ ├── opt_adpcm-v3.mvc │ │ │ │ │ ├── opt_adpcm-v3.rmc.ps │ │ │ │ │ ├── opt_adpcm-v3.rmc.xg │ │ │ │ │ ├── opt_adpcm-v3.sim │ │ │ │ │ ├── opt_adpcm-v3.tfc │ │ │ │ │ ├── opt_adpcm-v3.xg │ │ │ │ │ ├── opt_adpcm-v4-grp1-distr.ps │ │ │ │ │ ├── opt_adpcm-v4-grp1.xg │ │ │ │ │ ├── opt_adpcm-v4-mnecount.ps │ │ │ │ │ ├── opt_adpcm-v4.asm │ │ │ │ │ ├── opt_adpcm-v4.c │ │ │ │ │ ├── opt_adpcm-v4.imc.ps │ │ │ │ │ ├── opt_adpcm-v4.imc.xg │ │ │ │ │ ├── opt_adpcm-v4.inf │ │ │ │ │ ├── opt_adpcm-v4.lst │ │ │ │ │ ├── opt_adpcm-v4.mmc.ps │ │ │ │ │ ├── opt_adpcm-v4.mmc.xg │ │ │ │ │ ├── opt_adpcm-v4.mvc │ │ │ │ │ ├── opt_adpcm-v4.rmc.ps │ │ │ │ │ ├── opt_adpcm-v4.rmc.xg │ │ │ │ │ ├── opt_adpcm-v4.sim │ │ │ │ │ ├── opt_adpcm-v4.tfc │ │ │ │ │ ├── opt_adpcm-v4.xg │ │ │ │ │ ├── play │ │ │ │ │ ├── record │ │ │ │ │ ├── sample.out │ │ │ │ │ └── show │ │ │ │ └── total_count │ │ │ │ │ ├── README │ │ │ │ │ ├── adpt_predict.asm │ │ │ │ │ ├── adpt_predict.c │ │ │ │ │ ├── adpt_predict.inf │ │ │ │ │ ├── adpt_predict.lst │ │ │ │ │ ├── adpt_predict.mvc │ │ │ │ │ ├── adpt_predict.tfc │ │ │ │ │ ├── fmult.asm │ │ │ │ │ ├── fmult.c │ │ │ │ │ ├── fmult.inf │ │ │ │ │ ├── fmult.lst │ │ │ │ │ ├── fmult.mvc │ │ │ │ │ ├── fmult.tfc │ │ │ │ │ ├── iadpt_quant.asm │ │ │ │ │ ├── iadpt_quant.c │ │ │ │ │ ├── iadpt_quant.inf │ │ │ │ │ ├── iadpt_quant.lst │ │ │ │ │ ├── iadpt_quant.mvc │ │ │ │ │ ├── iadpt_quant.tfc │ │ │ │ │ ├── mnemonic_histogram.ps │ │ │ │ │ ├── mnemonic_histogram_original.ps │ │ │ │ │ ├── move+transfer_distribution.ps │ │ │ │ │ ├── move+transfer_distribution_orig.ps │ │ │ │ │ ├── opt_adpcm-grp1-orig.inf │ │ │ │ │ ├── opt_adpcm-grp1-orig.xg │ │ │ │ │ ├── opt_adpcm-grp1.inf │ │ │ │ │ ├── opt_adpcm-grp1.xg │ │ │ │ │ ├── opt_adpcm-orig.inf │ │ │ │ │ ├── opt_adpcm-orig.xg │ │ │ │ │ ├── opt_adpcm.asm │ │ │ │ │ ├── opt_adpcm.c │ │ │ │ │ ├── opt_adpcm.inf │ │ │ │ │ ├── opt_adpcm.loop1 │ │ │ │ │ ├── opt_adpcm.loop2 │ │ │ │ │ ├── opt_adpcm.loop3 │ │ │ │ │ ├── opt_adpcm.loop4 │ │ │ │ │ ├── opt_adpcm.loop5 │ │ │ │ │ ├── opt_adpcm.loop6 │ │ │ │ │ ├── opt_adpcm.loop7 │ │ │ │ │ ├── opt_adpcm.lst │ │ │ │ │ ├── opt_adpcm.mvc │ │ │ │ │ ├── opt_adpcm.tfc │ │ │ │ │ ├── opt_adpcm.xg │ │ │ │ │ ├── opt_adpcm_total.inf │ │ │ │ │ ├── opt_adpcm_total.xg │ │ │ │ │ ├── scale_factor.asm │ │ │ │ │ ├── scale_factor.c │ │ │ │ │ ├── scale_factor.inf │ │ │ │ │ ├── scale_factor.lst │ │ │ │ │ ├── scale_factor.mvc │ │ │ │ │ ├── scale_factor.tfc │ │ │ │ │ ├── show │ │ │ │ │ ├── showgraph │ │ │ │ │ ├── showoriginal │ │ │ │ │ ├── speed_control.asm │ │ │ │ │ ├── speed_control.c │ │ │ │ │ ├── speed_control.inf │ │ │ │ │ ├── speed_control.lst │ │ │ │ │ ├── speed_control.mvc │ │ │ │ │ ├── speed_control.tfc │ │ │ │ │ ├── tone_detector.asm │ │ │ │ │ ├── tone_detector.c │ │ │ │ │ ├── tone_detector.inf │ │ │ │ │ ├── tone_detector.lst │ │ │ │ │ ├── tone_detector.mvc │ │ │ │ │ └── tone_detector.tfc │ │ │ ├── is2_flt_adpcm │ │ │ │ ├── Makefile │ │ │ │ ├── README │ │ │ │ ├── compile │ │ │ │ ├── data.in │ │ │ │ ├── data.in.2freq │ │ │ │ ├── data.in.sinus │ │ │ │ ├── data.out │ │ │ │ ├── data_in.c │ │ │ │ ├── datain.tmp │ │ │ │ ├── dataout.tmp │ │ │ │ ├── error.tmp │ │ │ │ ├── flt_adpcm.asm │ │ │ │ ├── flt_adpcm.c │ │ │ │ ├── flt_adpcm.cld │ │ │ │ ├── flt_adpcm.exe │ │ │ │ ├── flt_adpcm.inf │ │ │ │ ├── flt_adpcm.lst │ │ │ │ ├── flt_adpcm.xg │ │ │ │ ├── runme │ │ │ │ └── showgraph │ │ │ ├── itu_sun │ │ │ │ ├── Makefile │ │ │ │ ├── Makefile.orig │ │ │ │ ├── README │ │ │ │ ├── ccitt.a │ │ │ │ ├── decode │ │ │ │ ├── decode.c │ │ │ │ ├── encode │ │ │ │ ├── encode.c │ │ │ │ ├── g711.c │ │ │ │ ├── g721.c │ │ │ │ ├── g723_24.c │ │ │ │ ├── g723_40.c │ │ │ │ ├── g72x.c │ │ │ │ └── g72x.h │ │ │ ├── portab.h │ │ │ ├── portab.h.tex │ │ │ ├── test-seq │ │ │ │ ├── testseq │ │ │ │ └── testseq.unix │ │ │ └── verify.c │ │ ├── complex_multiply │ │ │ ├── CMakeLists.txt │ │ │ └── complex_multiply.cpp │ │ ├── complex_update │ │ │ ├── CMakeLists.txt │ │ │ └── complex_update.cpp │ │ ├── convolution │ │ │ ├── CMakeLists.txt │ │ │ └── convolution.cpp │ │ ├── dot_product │ │ │ ├── CMakeLists.txt │ │ │ └── dot_product.cpp │ │ ├── fft │ │ │ ├── CMakeLists.txt │ │ │ ├── include │ │ │ │ ├── convert.c │ │ │ │ ├── debug.c │ │ │ │ ├── fft_bit_reduct.c │ │ │ │ ├── fft_inpsca.c │ │ │ │ ├── input_data │ │ │ │ │ ├── input1024.dat │ │ │ │ │ ├── input16.dat │ │ │ │ │ ├── twids1024-13.dat │ │ │ │ │ ├── twids1024-7.dat │ │ │ │ │ ├── twids16-13.dat │ │ │ │ │ └── twids16-7.dat │ │ │ │ ├── main1024_bit_reduct.h │ │ │ │ ├── main1024_inpsca.h │ │ │ │ ├── main16_bit_reduct.h │ │ │ │ └── main16_inpsca.h │ │ │ ├── main1024_bit_reduct.cpp │ │ │ ├── main1024_inpsca.cpp │ │ │ ├── main16_bit_reduct.cpp │ │ │ └── main16_inpsca.cpp │ │ ├── fir │ │ │ ├── CMakeLists.txt │ │ │ └── fir.cpp │ │ ├── fir2dim │ │ │ ├── CMakeLists.txt │ │ │ └── fir2dim.cpp │ │ ├── iir_biquad_N_sections │ │ │ ├── CMakeLists.txt │ │ │ └── biquad_N_sections.cpp │ │ ├── iir_biquad_one_section │ │ │ ├── CMakeLists.txt │ │ │ └── biquad_one_section.cpp │ │ ├── lms │ │ │ ├── CMakeLists.txt │ │ │ └── lms.cpp │ │ ├── matrix │ │ │ ├── CMakeLists.txt │ │ │ ├── matrix1.cpp │ │ │ └── matrix2.cpp │ │ ├── matrix1x3 │ │ │ ├── CMakeLists.txt │ │ │ └── mat1x3.cpp │ │ ├── n_complex_updates │ │ │ ├── CMakeLists.txt │ │ │ └── n_complex_updates.cpp │ │ ├── n_real_updates │ │ │ ├── CMakeLists.txt │ │ │ └── n_real_updates.cpp │ │ ├── real_update │ │ │ ├── CMakeLists.txt │ │ │ └── real_update.cpp │ │ └── startup │ │ │ ├── CMakeLists.txt │ │ │ └── startup.cpp │ └── benchmark.pl ├── cmake │ ├── FindLLVM.cmake │ ├── FindLLVMGCC.cmake │ ├── FindSystemC.cmake │ └── FindVerilator.cmake ├── common_config.lua.in ├── extract_timing.tcl ├── liblegup.bc ├── quartus_compile.tcl ├── report_json_data.tcl ├── setup_proj_symain.tcl.in ├── test_config.lua.in └── test_config_main.lua.in ├── tools ├── CMakeLists.txt ├── LLVMBuild.txt └── sync │ ├── CMakeLists.txt │ ├── LLVMBuild.txt │ └── sync.cpp └── util ├── Avalon.lua ├── IPIFtemplate.lua ├── TestAllDelayandLEs ├── Addtest.v.in ├── BuildMuxTable.py.in ├── CMakeLists.txt ├── Cmptest.v.in ├── Json2LuaScript_MUX.py ├── Json2LuaScript_Others.py ├── Multest.v.in ├── MuxReadRpt.py.in ├── ReadRpt.py.in ├── Redtest.v.in ├── Seltest.v.in ├── Shifttest.v.in ├── TestSetPrj.tcl.in ├── extract_timing.tcl.in └── test.sdc └── llvm-16436dffb50fac4677c7162639f8da0b73eb4e99.patch /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text eol=lf 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | 24 | *.exe binary 25 | *.a binary 26 | *.o binary 27 | testsuite/benchmark/DSPStone/adpcm/is2_flt_adpcm/data.in binary 28 | testsuite/benchmark/DSPStone/adpcm/is2_flt_adpcm/data.in.2freq binary 29 | testsuite/benchmark/DSPStone/adpcm/is2_flt_adpcm/data.in.sinus binary 30 | testsuite/benchmark/DSPStone/adpcm/test-seq/testseq binary 31 | -------------------------------------------------------------------------------- /LLVMBuild.txt: -------------------------------------------------------------------------------- 1 | ;===- ./lib/Target/VerilogBackend/LLVMBuild.txt -----------------------*- Conf -*--===; 2 | ; 3 | ; The LLVM Compiler Infrastructure 4 | ; 5 | ; This file is distributed under the University of Illinois Open Source 6 | ; License. See LICENSE.TXT for details. 7 | ; 8 | ;===------------------------------------------------------------------------===; 9 | ; 10 | ; This is an LLVMBuild description file for the components in this subdirectory. 11 | ; 12 | ; For more information on the LLVMBuild system, please see: 13 | ; 14 | ; http://llvm.org/docs/LLVMBuild.html 15 | ; 16 | ;===------------------------------------------------------------------------===; 17 | 18 | [common] 19 | subdirectories = MCTargetDesc lib tools 20 | 21 | [component_0] 22 | type = TargetGroup 23 | name = VerilogBackend 24 | parent = Target 25 | has_asmprinter = 0 26 | 27 | [component_1] 28 | type = Library 29 | name = VerilogBackendCodegen 30 | parent = VerilogBackend 31 | required_libraries = AsmPrinter CodeGen Core SelectionDAG Support Target MC VTMBitLevelOpt VTMHighLevelOpt VTMSchedule VTMRTLCodegen VTMScripting VerilogBackendDesc 32 | add_to_library_groups = VerilogBackend 33 | -------------------------------------------------------------------------------- /MCTargetDesc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) 2 | add_llvm_library(LLVMVerilogBackendDesc 3 | VerilogBackendMCTargetDesc.cpp 4 | ) 5 | 6 | add_dependencies(LLVMVerilogBackendDesc VerilogBackendTableGen) 7 | -------------------------------------------------------------------------------- /MCTargetDesc/LLVMBuild.txt: -------------------------------------------------------------------------------- 1 | ;===- ./lib/Target/VerilogBackend/MCTargetDesc/LLVMBuild.txt ---*- Conf -*--===; 2 | ; 3 | ; The LLVM Compiler Infrastructure 4 | ; 5 | ; This file is distributed under the University of Illinois Open Source 6 | ; License. See LICENSE.TXT for details. 7 | ; 8 | ;===------------------------------------------------------------------------===; 9 | ; 10 | ; This is an LLVMBuild description file for the components in this subdirectory. 11 | ; 12 | ; For more information on the LLVMBuild system, please see: 13 | ; 14 | ; http://llvm.org/docs/LLVMBuild.html 15 | ; 16 | ;===------------------------------------------------------------------------===; 17 | 18 | [component_0] 19 | type = Library 20 | name = VerilogBackendDesc 21 | parent = VerilogBackend 22 | required_libraries = MC 23 | add_to_library_groups = VerilogBackend 24 | -------------------------------------------------------------------------------- /VFrameLowering.h: -------------------------------------------------------------------------------- 1 | //====---- VTMFrameInfo.h - Define TargetFrameInfo for VTM --*- C++ -*----====// 2 | // 3 | // The Shang HLS frameowrk // 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | // 10 | // 11 | // 12 | //===----------------------------------------------------------------------===// 13 | 14 | #ifndef VTM_FRAMEINFO_H 15 | #define VTM_FRAMEINFO_H 16 | #include "vtm/VerilogBackendMCTargetDesc.h" 17 | #include "llvm/Target/TargetFrameLowering.h" 18 | 19 | namespace llvm { 20 | class VSubtarget; 21 | class AllocaInst; 22 | 23 | class VFrameInfo : public TargetFrameLowering { 24 | protected: 25 | 26 | public: 27 | VFrameInfo() : TargetFrameLowering(TargetFrameLowering::StackGrowsDown, 2, -2) { 28 | } 29 | 30 | /// emitProlog/emitEpilog - These methods insert prolog and epilog code into 31 | /// the function. 32 | void emitPrologue(MachineFunction &MF) const; 33 | void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const; 34 | 35 | bool hasFP(const MachineFunction &MF) const { return false; } 36 | }; 37 | 38 | } // End llvm namespace 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /VIntrinsics.td: -------------------------------------------------------------------------------- 1 | //===- VIntrinsics.td - Defines VTM intrinsics -------------*- tablegen -*-===// 2 | // 3 | // The Shang HLS frameowrk // 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | // 10 | // This file defines all of the VTM-specific intrinsics. 11 | // 12 | //===----------------------------------------------------------------------===// 13 | 14 | //===----------------------------------------------------------------------===// 15 | // Definitions for all VTM intrinsics. 16 | // 17 | 18 | let TargetPrefix = "vtm", isTarget = 1 in { 19 | // The dummy intrinsics that mark a pointer to the result of alloca is alias 20 | // with a global address. 21 | def int_vtm_privatize_global : Intrinsic<[], 22 | [llvm_anyptr_ty], 23 | [IntrReadWriteArgMem, 24 | NoCapture<0>]>; 25 | // Annotate bram information, including the block ram number, 26 | // number of elements, element size in bytes, and the initilize global 27 | // variable address. 28 | def int_vtm_annotated_bram_info : Intrinsic<[], 29 | [llvm_i32_ty, llvm_i32_ty, 30 | llvm_i32_ty, llvm_anyptr_ty], 31 | [IntrReadWriteArgMem, 32 | NoCapture<3>]>; 33 | }//FIXME: add multi-dimension support 34 | -------------------------------------------------------------------------------- /VIntrinsicsInfo.h: -------------------------------------------------------------------------------- 1 | //===- VTMIntrinsicInfo.h - VTM Intrinsic Information -----*- C++ -*-===// 2 | // 3 | // The Shang HLS frameowrk // 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | // 10 | // This file contains the VTM implementation of TargetIntrinsicInfo. 11 | // 12 | //===----------------------------------------------------------------------===// 13 | #ifndef VTM_INTRINSICS_H 14 | #define VTM_INTRINSICS_H 15 | 16 | #include "vtm/VerilogBackendMCTargetDesc.h" 17 | 18 | #include "llvm/IntrinsicInst.h" 19 | #include "llvm/Target/TargetIntrinsicInfo.h" 20 | 21 | namespace llvm { 22 | class VIntrinsicInfo : public TargetIntrinsicInfo { 23 | public: 24 | std::string getName(unsigned IntrID, Type **Tys = 0, 25 | unsigned numTys = 0) const; 26 | 27 | unsigned lookupName(const char *Name, unsigned Len) const; 28 | 29 | unsigned lookupGCCName(const char *Name) const; 30 | 31 | bool isOverloaded(unsigned IID) const; 32 | 33 | Function *getDeclaration(Module *M, unsigned ID, Type **Tys = 0, 34 | unsigned numTys = 0) const; 35 | }; 36 | 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /VTM.td: -------------------------------------------------------------------------------- 1 | //===------ VTM.td - Describe the Verilog Target Machine ---*- tablegen -*-===// 2 | // 3 | // The Shang HLS frameowrk // 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | // 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | //===----------------------------------------------------------------------===// 14 | // Target-independent interfaces which we are implementing 15 | //===----------------------------------------------------------------------===// 16 | 17 | include "llvm/Target/Target.td" 18 | 19 | //===----------------------------------------------------------------------===// 20 | // Register File, Calling Conv, Instruction Descriptions 21 | //===----------------------------------------------------------------------===// 22 | 23 | include "VRegisterInfo.td" 24 | include "VIntrinsics.td" 25 | include "VInstrInfo.td" 26 | 27 | def VInstrInfo : InstrInfo {} 28 | 29 | //===----------------------------------------------------------------------===// 30 | // Declare the target which we are implementing 31 | //===----------------------------------------------------------------------===// 32 | 33 | def VTM : Target { 34 | // Pull in Instruction Info: 35 | let InstructionSet = VInstrInfo; 36 | } 37 | -------------------------------------------------------------------------------- /cmake/FindABC.cmake: -------------------------------------------------------------------------------- 1 | FIND_PATH(ABC_INCLUDE_DIR alanmi-abc/src/) 2 | 3 | FIND_LIBRARY(ABC_LIBRARY NAMES abcd) 4 | 5 | IF (ABC_INCLUDE_DIR AND ABC_LIBRARY) 6 | SET(ABC_FOUND TRUE) 7 | ENDIF (ABC_INCLUDE_DIR AND ABC_LIBRARY) 8 | 9 | 10 | IF (ABC_FOUND) 11 | IF (NOT ABC_FIND_QUIETLY) 12 | MESSAGE(STATUS "Found ABC: ${ABC_LIBRARY}") 13 | ENDIF (NOT ABC_FIND_QUIETLY) 14 | ELSE (ABC_FOUND) 15 | IF (ABC_FIND_REQUIRED) 16 | MESSAGE(FATAL_ERROR "Could not find ABC") 17 | ENDIF (ABC_FIND_REQUIRED) 18 | ENDIF (ABC_FOUND) 19 | 20 | -------------------------------------------------------------------------------- /cmake/FindBOOST.cmake: -------------------------------------------------------------------------------- 1 | FIND_PATH(BOOST_INCLUDE_DIR boost/weak_ptr.hpp) 2 | 3 | IF (BOOST_INCLUDE_DIR) 4 | SET(BOOST_FOUND TRUE) 5 | ENDIF (BOOST_INCLUDE_DIR) 6 | 7 | 8 | IF (BOOST_FOUND) 9 | IF (NOT BOOST_FIND_QUIETLY) 10 | MESSAGE(STATUS "Found BOOST: ${BOOST_INCLUDE_DIR}") 11 | ENDIF (NOT BOOST_FIND_QUIETLY) 12 | ELSE (BOOST_FOUND) 13 | IF (BOOST_FIND_REQUIRED) 14 | MESSAGE(FATAL_ERROR "Could not find BOOST") 15 | ENDIF (BOOST_FIND_REQUIRED) 16 | ENDIF (BOOST_FOUND) 17 | 18 | -------------------------------------------------------------------------------- /cmake/FindLpSolve.cmake: -------------------------------------------------------------------------------- 1 | #Please note that we are using lpsolve 5.5 2 | FIND_PATH(LPSOLVE_INCLUDE_DIR lpsolve/lp_lib.h) 3 | 4 | FIND_LIBRARY(LPSOLVE_LIBRARY NAMES liblpsolve55) 5 | 6 | IF (NOT LPSOLVE_INCLUDE_DIR) 7 | MESSAGE(FATAL_ERROR "Cannot find LPSOLVE headers!") 8 | ENDIF (NOT LPSOLVE_INCLUDE_DIR) 9 | 10 | IF (NOT LPSOLVE_LIBRARY) 11 | MESSAGE(FATAL_ERROR "Cannot find LPSOLVE libraries!") 12 | ENDIF (NOT LPSOLVE_LIBRARY) 13 | 14 | IF (NOT LpSolve_FIND_QUIETLY) 15 | MESSAGE(STATUS "Found LpSolve: ${LPSOLVE_LIBRARY}") 16 | ENDIF (NOT LpSolve_FIND_QUIETLY) 17 | 18 | -------------------------------------------------------------------------------- /cmake/FindLua.cmake: -------------------------------------------------------------------------------- 1 | #Please note that we are using lua 5.1 2 | FIND_PATH(LUA_INCLUDE_DIR lua.h) 3 | 4 | IF (NOT LUA_INCLUDE_DIR) 5 | MESSAGE(FATAL_ERROR "Cannot find LUA headers!") 6 | ENDIF (NOT LUA_INCLUDE_DIR) 7 | 8 | FIND_LIBRARY(LUA_LIBRARY NAMES lua) 9 | 10 | IF (NOT LUA_LIBRARY) 11 | MESSAGE(FATAL_ERROR "Cannot find LUA libraries!") 12 | ENDIF (NOT LUA_LIBRARY) 13 | 14 | #Use luac->bin2c in windows to generate c code for luapp. 15 | IF (MSVC) 16 | FIND_PROGRAM(LUA_LUAC luac) 17 | 18 | IF (NOT LUA_LUAC) 19 | MESSAGE(FATAL_ERROR "Cannot find luac!") 20 | ENDIF (NOT LUA_LUAC) 21 | 22 | FIND_PROGRAM(LUA_BIN2C bin2c) 23 | 24 | IF (NOT LUA_BIN2C) 25 | MESSAGE(FATAL_ERROR "Cannot find bin2c!") 26 | ENDIF (NOT LUA_BIN2C) 27 | ELSE(MSVC) 28 | FIND_PROGRAM(LUA_INTERPRETER lua) 29 | 30 | IF (NOT LUA_INTERPRETER) 31 | MESSAGE(FATAL_ERROR "Cannot find interpreter!") 32 | ENDIF (NOT LUA_INTERPRETER) 33 | ENDIF(MSVC) 34 | 35 | IF (NOT Lua_FIND_QUIETLY) 36 | MESSAGE(STATUS "Found Lua: ${LUA_LIBRARY}") 37 | ENDIF (NOT Lua_FIND_QUIETLY) 38 | 39 | -------------------------------------------------------------------------------- /cmake/FindLuaBind.cmake: -------------------------------------------------------------------------------- 1 | FIND_PATH(LUABIND_INCLUDE_DIR luabind/luabind.hpp) 2 | 3 | FIND_LIBRARY(LUABIND_LIBRARY NAMES libluabind) 4 | 5 | IF (LUABIND_INCLUDE_DIR AND LUABIND_LIBRARY) 6 | SET(LUABIND_FOUND TRUE) 7 | ENDIF (LUABIND_INCLUDE_DIR AND LUABIND_LIBRARY) 8 | 9 | 10 | IF (LUABIND_FOUND) 11 | IF (NOT LuaBind_FIND_QUIETLY) 12 | MESSAGE(STATUS "Found LuaBind: ${LUABIND_LIBRARY}") 13 | ENDIF (NOT LuaBind_FIND_QUIETLY) 14 | ELSE (LUABIND_FOUND) 15 | IF (LuaBind_FIND_REQUIRED) 16 | MESSAGE(FATAL_ERROR "Could not find LuaBind") 17 | ENDIF (LuaBind_FIND_REQUIRED) 18 | ENDIF (LUABIND_FOUND) 19 | 20 | -------------------------------------------------------------------------------- /include/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(vtm) -------------------------------------------------------------------------------- /include/vtm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if( MSVC_IDE OR XCODE ) 2 | # Creates a dummy target containing all headers for the benefit of 3 | # Visual Studio users. 4 | file(GLOB_RECURSE headers *.h) 5 | add_library(vtm_headers_do_not_build EXCLUDE_FROM_ALL 6 | # We need at least one source file: 7 | ${LLVM_MAIN_SRC_DIR}/lib/Transforms/Hello/Hello.cpp 8 | ${headers}) 9 | endif() 10 | -------------------------------------------------------------------------------- /include/vtm/VerilogBackendMCTargetDesc.h: -------------------------------------------------------------------------------- 1 | //===-- VBackend.h - Top-level interface for Verilog backend ----*- C++ -*-===// 2 | // 3 | // The Shang HLS frameowrk // 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | // 10 | // This file contains the entry points for global functions defined in the LLVM 11 | // Verilog back-end. 12 | // 13 | //===----------------------------------------------------------------------===// 14 | 15 | #ifndef VERILOGBACKEND_MC_TARGET_DESC_H 16 | #define VERILOGBACKEND_MC_TARGET_DESC_H 17 | 18 | #include "llvm/Intrinsics.h" 19 | #include "llvm/Target/TargetMachine.h" 20 | namespace llvm { 21 | extern Target TheVBackendTarget; 22 | } // end namespace llvm 23 | 24 | namespace vtmIntrinsic { 25 | enum ID { 26 | last_non_vtm_intrinsic = llvm::Intrinsic::num_intrinsics - 1, 27 | #define GET_INTRINSIC_ENUM_VALUES 28 | #include "VerilogBackendGenIntrinsics.inc" 29 | #undef GET_INTRINSIC_ENUM_VALUES 30 | , num_vtm_intrinsics 31 | }; 32 | } 33 | 34 | // Defines symbolic names for the Verilog TargetMachine registers. This defines 35 | // a mapping from register name to register number. 36 | #define GET_REGINFO_ENUM 37 | #include "VerilogBackendGenRegisterInfo.inc" 38 | 39 | #define GET_INSTRINFO_ENUM 40 | #include "VerilogBackendGenInstrInfo.inc" 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /include/vtm/VerilogModuleAnalysis.h: -------------------------------------------------------------------------------- 1 | //===------------------------VerilogModuleAnalysis.cpp--------------------------------===// 2 | // 3 | // The Shang HLS frameowrk // 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | // 10 | // Define the VerilogModuleAnalysis pass, which is the container of the 11 | // VASTModule. 12 | // 13 | //===----------------------------------------------------------------------===// 14 | 15 | #include "llvm/CodeGen/MachineFunctionPass.h" 16 | 17 | 18 | namespace llvm { 19 | class VASTModule; 20 | class VASTExprBuilder; 21 | 22 | class VerilogModuleAnalysis : public MachineFunctionPass { 23 | VASTModule *Module; 24 | public: 25 | static char ID; 26 | 27 | VerilogModuleAnalysis(); 28 | 29 | bool runOnMachineFunction(MachineFunction &MF); 30 | void releaseMemory(); 31 | 32 | VASTModule *createModule(const std::string &Name, VASTExprBuilder *Builder); 33 | VASTModule *getModule() const { 34 | assert(Module && "The module is not yet created!"); 35 | return Module; 36 | } 37 | }; 38 | } 39 | -------------------------------------------------------------------------------- /lib/BitLevelOpt/LLVMBuild.txt: -------------------------------------------------------------------------------- 1 | ;===- ./lib/Target/VerilogBackend/lib/BitLevelOpt/LLVMBuild.txt ------------*- Conf -*--===; 2 | ; 3 | ; The LLVM Compiler Infrastructure 4 | ; 5 | ; This file is distributed under the University of Illinois Open Source 6 | ; License. See LICENSE.TXT for details. 7 | ; 8 | ;===------------------------------------------------------------------------===; 9 | ; 10 | ; This is an LLVMBuild description file for the components in this subdirectory. 11 | ; 12 | ; For more information on the LLVMBuild system, please see: 13 | ; 14 | ; http://llvm.org/docs/LLVMBuild.html 15 | ; 16 | ;===------------------------------------------------------------------------===; 17 | 18 | [component_0] 19 | type = Library 20 | name = VTMBitLevelOpt 21 | parent = VerilogBackend 22 | add_to_library_groups = VerilogBackend 23 | -------------------------------------------------------------------------------- /lib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(HighLevelOpt) 2 | add_subdirectory(BitLevelOpt) 3 | add_subdirectory(Schedule) 4 | add_subdirectory(RTLCodegen) 5 | add_subdirectory(Scripting) 6 | -------------------------------------------------------------------------------- /lib/HighLevelOpt/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_llvm_library(VTMHighLevelOpt 2 | FunctionFilter.cpp 3 | HLSInliner.cpp 4 | TrivialLoopUnrollPass.cpp 5 | ) 6 | 7 | llvm_config(VTMHighLevelOpt transformutils ipo) 8 | 9 | add_dependencies(VTMHighLevelOpt VerilogBackendTableGen) 10 | -------------------------------------------------------------------------------- /lib/HighLevelOpt/LLVMBuild.txt: -------------------------------------------------------------------------------- 1 | ;===- ./lib/Target/VerilogBackend/lib/HighLevelOpt/LLVMBuild.txt ------------*- Conf -*--===; 2 | ; 3 | ; The LLVM Compiler Infrastructure 4 | ; 5 | ; This file is distributed under the University of Illinois Open Source 6 | ; License. See LICENSE.TXT for details. 7 | ; 8 | ;===------------------------------------------------------------------------===; 9 | ; 10 | ; This is an LLVMBuild description file for the components in this subdirectory. 11 | ; 12 | ; For more information on the LLVMBuild system, please see: 13 | ; 14 | ; http://llvm.org/docs/LLVMBuild.html 15 | ; 16 | ;===------------------------------------------------------------------------===; 17 | 18 | [component_0] 19 | type = Library 20 | name = VTMHighLevelOpt 21 | parent = VerilogBackend 22 | required_libraries = TransformUtils IPO 23 | add_to_library_groups = VerilogBackend 24 | -------------------------------------------------------------------------------- /lib/LLVMBuild.txt: -------------------------------------------------------------------------------- 1 | ;===- ./lib/Target/VerilogBackend/lib/LLVMBuild.txt ------------*- Conf -*--===; 2 | ; 3 | ; The LLVM Compiler Infrastructure 4 | ; 5 | ; This file is distributed under the University of Illinois Open Source 6 | ; License. See LICENSE.TXT for details. 7 | ; 8 | ;===------------------------------------------------------------------------===; 9 | ; 10 | ; This is an LLVMBuild description file for the components in this subdirectory. 11 | ; 12 | ; For more information on the LLVMBuild system, please see: 13 | ; 14 | ; http://llvm.org/docs/LLVMBuild.html 15 | ; 16 | ;===------------------------------------------------------------------------===; 17 | 18 | [common] 19 | subdirectories = BitLevelOpt HighLevelOpt RTLCodegen Schedule Scripting 20 | -------------------------------------------------------------------------------- /lib/RTLCodegen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_llvm_library(VTMRTLCodegen 2 | RTLCodegenPrepare.cpp 3 | VerilogModuleAnalysis.cpp 4 | VASTExprBuilder.cpp 5 | VerilogASTBuilder.cpp 6 | VerilogASTWriter.cpp 7 | IR2Datapath.cpp 8 | DesignMetrics.cpp 9 | MachineFunction2Datapath.cpp 10 | PreSchedRTLOpt.cpp 11 | ControlLogicBuilder.cpp 12 | CombPathDelayAnalysis.cpp 13 | RtlSSAAnalysis.cpp 14 | ) 15 | 16 | add_dependencies(VTMRTLCodegen VerilogBackendTableGen) 17 | -------------------------------------------------------------------------------- /lib/RTLCodegen/LLVMBuild.txt: -------------------------------------------------------------------------------- 1 | ;===- ./lib/Target/VerilogBackend/lib/RTLCodegen/LLVMBuild.txt ------------*- Conf -*--===; 2 | ; 3 | ; The LLVM Compiler Infrastructure 4 | ; 5 | ; This file is distributed under the University of Illinois Open Source 6 | ; License. See LICENSE.TXT for details. 7 | ; 8 | ;===------------------------------------------------------------------------===; 9 | ; 10 | ; This is an LLVMBuild description file for the components in this subdirectory. 11 | ; 12 | ; For more information on the LLVMBuild system, please see: 13 | ; 14 | ; http://llvm.org/docs/LLVMBuild.html 15 | ; 16 | ;===------------------------------------------------------------------------===; 17 | 18 | [component_0] 19 | type = Library 20 | name = VTMRTLCodegen 21 | parent = VerilogBackend 22 | add_to_library_groups = VerilogBackend 23 | -------------------------------------------------------------------------------- /lib/RTLCodegen/VerilogModuleAnalysis.cpp: -------------------------------------------------------------------------------- 1 | //===--------------------VerilogModuleAnalysis.cpp------------------------===// 2 | // 3 | // The Shang HLS frameowrk // 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | // 10 | // Implement the VerilogModuleAnalysis pass, which is the container of the 11 | // VASTModule. 12 | // 13 | //===----------------------------------------------------------------------===// 14 | #include "vtm/Passes.h" 15 | #include "vtm/VerilogModuleAnalysis.h" 16 | #include "vtm/VerilogAST.h" 17 | #include "vtm/VerilogAST.h" 18 | 19 | using namespace llvm; 20 | 21 | INITIALIZE_PASS(VerilogModuleAnalysis, "verilog-module-analysis", 22 | "verilog module analysis", false, true) 23 | 24 | char VerilogModuleAnalysis::ID = 0; 25 | 26 | VerilogModuleAnalysis::VerilogModuleAnalysis():MachineFunctionPass(ID),Module(0) 27 | { 28 | initializeVerilogModuleAnalysisPass(*PassRegistry::getPassRegistry()); 29 | } 30 | 31 | bool VerilogModuleAnalysis::runOnMachineFunction(MachineFunction &MF){ 32 | return false; 33 | } 34 | 35 | VASTModule *VerilogModuleAnalysis::createModule(const std::string &Name, 36 | VASTExprBuilder *Builder) { 37 | assert(Module == 0 && "Module has been already created!"); 38 | Module = new VASTModule(Name, Builder); 39 | return Module; 40 | } 41 | 42 | void VerilogModuleAnalysis::releaseMemory() { 43 | if (Module == 0) return; 44 | 45 | delete Module; 46 | Module = 0; 47 | } 48 | -------------------------------------------------------------------------------- /lib/Schedule/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #Dirty Hack: We need to include some internal llvm header files. 2 | include_directories(${LLVM_MAIN_SRC_DIR}/lib/CodeGen) 3 | 4 | include_directories( 5 | ${LPSOLVE_INCLUDE_DIR} 6 | ) 7 | 8 | add_llvm_library(VTMSchedule 9 | AdjustLIForBundles.cpp 10 | ChainBreakingAnalysis.cpp 11 | CompGraph.cpp 12 | DetailLatencyInfo.cpp 13 | PrebindMuxBase.cpp 14 | RecurrenceFinder.cpp 15 | ScheduleEmitter.cpp 16 | Schedulers.cpp 17 | SchedulingBase.cpp 18 | SDCScheduler.cpp 19 | UnbalanceMuxPrebind.cpp 20 | VSUnit.cpp 21 | VPreRegAllocSched.cpp 22 | VRegAllocSimple.cpp 23 | VAliasAnalysis.cpp 24 | ) 25 | 26 | target_link_libraries ( 27 | VTMSchedule 28 | ${LPSOLVE_LIBRARY} 29 | ) 30 | 31 | add_dependencies(VTMSchedule VerilogBackendTableGen) 32 | -------------------------------------------------------------------------------- /lib/Schedule/ChainBreakingAnalysis.cpp: -------------------------------------------------------------------------------- 1 | //===-- ChainBreakingAnalysis.cpp - Chain Breaking Caculation ---*- C++ -*-===// 2 | // 3 | // The Shang HLS frameowrk // 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | // 10 | // This file implements the ChainBreakingAnalysis class. 11 | // The ChainBreakingAnalysis class calculates the best step to break the 12 | // multi-cycles chain during/after scheduling, to expose more FU sharing 13 | // opportunity. 14 | // 15 | //===----------------------------------------------------------------------===// 16 | 17 | #include "ChainBreakingAnalysis.h" 18 | #include "VSUnit.h" 19 | 20 | using namespace llvm; 21 | 22 | ScheduleLiveInterval::ScheduleLiveInterval(unsigned StartSlot, unsigned EndSlot) 23 | : StartSlot(StartSlot), EndSlot(EndSlot) { 24 | assert(StartSlot < EndSlot && "Bad interval!"); 25 | } 26 | 27 | unsigned ChainBreakingAnalysis::getBreakingSlot(const VSUnit *U) const { 28 | assert(U->isControl() && "Bad schedule unit type!"); 29 | return U->getFinSlot(); 30 | } 31 | -------------------------------------------------------------------------------- /lib/Schedule/CompGraph.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/lib/Schedule/CompGraph.cpp -------------------------------------------------------------------------------- /lib/Schedule/CompGraphTraits.h: -------------------------------------------------------------------------------- 1 | //===-- CompGraphTraits.h - Compatibility Graph Traits Template ---*- C++ -*-===// 2 | // 3 | // The Shang HLS frameowrk // 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | // 10 | // This file defines the little CompGraphTraits template class that should be 11 | // specialized by classes that want to be the data type of Compatibility Graph. 12 | // 13 | //===----------------------------------------------------------------------===// 14 | #ifndef COMPATIBILITY_GRAPH_TRAITS_H 15 | #define COMPATIBILITY_GRAPH_TRAITS_H 16 | 17 | namespace llvm { 18 | // CompGraphTraits - This class should be specialized by different node types... 19 | // which is why the default version is empty. 20 | template 21 | struct CompGraphTraits { 22 | // Elements to provide: 23 | 24 | // static bool isEarlier(NodeType *LHS, NodeType *RHS); 25 | // Return if LHS is earlier than RHS. 26 | 27 | // static bool compatible(NodeType *LHS, NodeType *RHS); 28 | // Return if LHS is compatible with RHS. 29 | 30 | typedef typename NodeType::UnknownNodeTypeError T; 31 | }; 32 | } 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /lib/Schedule/LLVMBuild.txt: -------------------------------------------------------------------------------- 1 | ;===- ./lib/Target/VerilogBackend/lib/Schedule/LLVMBuild.txt ------------*- Conf -*--===; 2 | ; 3 | ; The LLVM Compiler Infrastructure 4 | ; 5 | ; This file is distributed under the University of Illinois Open Source 6 | ; License. See LICENSE.TXT for details. 7 | ; 8 | ;===------------------------------------------------------------------------===; 9 | ; 10 | ; This is an LLVMBuild description file for the components in this subdirectory. 11 | ; 12 | ; For more information on the LLVMBuild system, please see: 13 | ; 14 | ; http://llvm.org/docs/LLVMBuild.html 15 | ; 16 | ;===------------------------------------------------------------------------===; 17 | 18 | [component_0] 19 | type = Library 20 | name = VTMSchedule 21 | parent = VerilogBackend 22 | add_to_library_groups = VerilogBackend 23 | -------------------------------------------------------------------------------- /lib/Scripting/LLVMBuild.txt: -------------------------------------------------------------------------------- 1 | ;===- ./lib/Target/VerilogBackend/lib/Scripting/LLVMBuild.txt ------------*- Conf -*--===; 2 | ; 3 | ; The LLVM Compiler Infrastructure 4 | ; 5 | ; This file is distributed under the University of Illinois Open Source 6 | ; License. See LICENSE.TXT for details. 7 | ; 8 | ;===------------------------------------------------------------------------===; 9 | ; 10 | ; This is an LLVMBuild description file for the components in this subdirectory. 11 | ; 12 | ; For more information on the LLVMBuild system, please see: 13 | ; 14 | ; http://llvm.org/docs/LLVMBuild.html 15 | ; 16 | ;===------------------------------------------------------------------------===; 17 | 18 | [component_0] 19 | type = Library 20 | name = VTMScripting 21 | parent = VerilogBackend 22 | add_to_library_groups = VerilogBackend 23 | -------------------------------------------------------------------------------- /testsuite/AccumulateStats.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python 2 | 3 | import re 4 | import sys 5 | 6 | KeyWord = sys.argv[1] 7 | 8 | StatsSum = 0 9 | 10 | RegexKeyWord = re.compile(KeyWord) 11 | 12 | for line in sys.stdin: 13 | #Get the line that we are interested in. 14 | if RegexKeyWord.search(line) : 15 | # Extract the number from the Stats line. 16 | StatsNum = int(re.match(r".*\d+", line).group()) 17 | print '+', StatsNum 18 | StatsSum += StatsNum 19 | print StatsSum 20 | elif re.search(r"High-levle Synthesising", line) : 21 | print line 22 | 23 | print StatsSum, KeyWord 24 | -------------------------------------------------------------------------------- /testsuite/BramGlobVar.lua: -------------------------------------------------------------------------------- 1 | Misc.CommonRTLGlobalScript = [=[ 2 | --Generate initialize file for block rams. 3 | for k,v in pairs(GlobalVariables) do 4 | if v.AddressSpace ~= 0 then 5 | if v.Initializer ~= nil then 6 | InitFile = io.open (test_binary_root .. '/' .. k .. '_init.txt', 'w') 7 | for i,n in ipairs(v.Initializer) do 8 | InitFile:write(string.sub(n, 3)..'\n') 9 | end 10 | io.close(InitFile) 11 | end 12 | end --end addresssapce == 0 13 | end 14 | 15 | local preprocess = require "luapp" . preprocess 16 | RTLGlobalCode, message = preprocess {input=RTLGlobalTemplate} 17 | if message ~= nil then print(message) end 18 | 19 | RTLGlobalCode = RTLGlobalCode .. FUs.CommonTemplate 20 | ]=] 21 | -------------------------------------------------------------------------------- /testsuite/EP2C35F672C6.lua: -------------------------------------------------------------------------------- 1 | FUs.ClkEnSelLatency = 1.535 / PERIOD --1.535 2 | FUs.MaxLutSize = 4 3 | FUs.MaxMuxPerLUT = 2 4 | FUs.LutLatency = 0.635 / PERIOD 5 | -- Latency table for EP2C35F672C6 6 | FUs.AddSub = { Latencies = { 1.994 / PERIOD, 2.752 / PERIOD, 4.055 / PERIOD, 6.648 / PERIOD }, 7 | Costs = {128, 576, 1088, 2112, 4160}, StartInterval=1, 8 | ChainingThreshold = ADDSUB_ChainingThreshold} 9 | FUs.Shift = { Latencies = { 3.073 / PERIOD, 3.711 / PERIOD, 5.209 / PERIOD, 6.403 / PERIOD }, 10 | Costs = {64, 1792, 4352, 10176, 26240}, StartInterval=1, 11 | ChainingThreshold = SHIFT_ChainingThreshold} 12 | FUs.Mult = { Latencies = { 2.181 / PERIOD, 2.504 / PERIOD, 6.503 / PERIOD, 9.229 / PERIOD }, 13 | Costs = {64, 4160, 8256, 39040, 160256}, StartInterval=1, 14 | ChainingThreshold = MULT_ChainingThreshold} 15 | FUs.ICmp = { Latencies = { 1.909 / PERIOD, 2.752 / PERIOD, 4.669 / PERIOD, 7.342 / PERIOD }, 16 | Costs = {64, 512, 1024, 2048, 4096}, StartInterval=1, 17 | ChainingThreshold = ICMP_ChainingThreshold} 18 | -------------------------------------------------------------------------------- /testsuite/ExpectFails: -------------------------------------------------------------------------------- 1 | sim_memcpy_libcall_opt 2 | mem_unalign 3 | op_shl 4 | 5 | -------------------------------------------------------------------------------- /testsuite/FixFailList.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ExpectFailListPath=$1 3 | CurrentFail=$2 4 | TargetFailListPath=$3 5 | 6 | while read line 7 | do 8 | #If the fail is expected, simply ignore it. 9 | [ "$line" = "$CurrentFail" ] && exit 0 10 | done < $ExpectFailListPath 11 | 12 | # Append the fail test to the fail list. 13 | echo "$CurrentFail" `find $PWD -name $CurrentFail*.bc` >> $TargetFailListPath 14 | 15 | -------------------------------------------------------------------------------- /testsuite/FuncDefine.lua: -------------------------------------------------------------------------------- 1 | --Return type with given size. 2 | function getType(Size) 3 | if Size == 0 then return "void" 4 | elseif Size == 1 then return "bool" 5 | elseif Size == 8 then return "unsigned char" 6 | elseif Size == 16 then return "unsigned short" 7 | elseif Size == 32 then return "unsigned int" 8 | elseif Size == 64 then return "unsigned long long" 9 | else return "bad-type" 10 | end 11 | end 12 | 13 | --Escape numbers for Verilator DPI-C functions. 14 | function number2Alpha(w) 15 | if w == '_' then 16 | return 's' 17 | else 18 | return string.char(string.byte(w) + 17) 19 | end 20 | end 21 | 22 | function escapeNumber(s) 23 | return string.gsub(s, "([%d\_])", number2Alpha) 24 | end 25 | 26 | --Decide the bit widths of return value 27 | function getRetPort(Size) 28 | if Size == 0 then return " " 29 | elseif Size == 64 then return "sc_signalreturn_value" 30 | else return "sc_signalreturn_value" 31 | end 32 | end 33 | 34 | --Giving the arguments type in SystemC 35 | function getBitWidth(Size) 36 | if Size == 1 then return "bool " 37 | elseif Size == 8 then return "unsigned int" 38 | elseif Size == 16 then return "unsigned int" 39 | elseif Size == 32 then return "uint32_t" 40 | elseif Size == 64 then return "uint64_t" 41 | else return "uint32_t" 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /testsuite/Loops/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_sources *.cpp) 2 | foreach(test_source ${test_sources}) 3 | get_filename_component(file_name ${test_source} NAME_WE) 4 | add_test_cases(${file_name}) 5 | endforeach() 6 | -------------------------------------------------------------------------------- /testsuite/Loops/cfg_loop.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #define N 30 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | void cfg_loop(unsigned a[]) __attribute__ ((noinline)); 11 | void cfg_loop(unsigned a[]) { 12 | long i; 13 | for (i = 0; i < N; ++i) 14 | a[i] = a[i + 2] + 3; 15 | } 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | int main(int argc, char **argv) { 21 | unsigned a[N + 2]; 22 | 23 | long i; 24 | for(i = 0; i < N + 2; ++i) 25 | a[i] = (unsigned) rand(); 26 | 27 | cfg_loop(a); 28 | 29 | for(i = 0; i < N + 2; ++i) 30 | printf("a[%d]:%d\n", i, a[i]); 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /testsuite/Loops/cfg_loop_pipe.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | void cfg_loop_pipe(unsigned a[], unsigned b) __attribute__ ((noinline)); 9 | void cfg_loop_pipe(unsigned a[], unsigned b) { 10 | long i; 11 | for (i = 0; i < 16; ++i) 12 | a[i] = (a[i + 2] << (b & 0x4)) + b; 13 | } 14 | #ifdef __cplusplus 15 | } 16 | #endif 17 | 18 | int main(int argc, char **argv) { 19 | unsigned a[18]; 20 | 21 | long i; 22 | for(i = 0; i < 18; ++i) 23 | a[i] = (unsigned) rand(); 24 | 25 | cfg_loop_pipe(a, 2); 26 | 27 | for(i = 0; i < 18; ++i) 28 | printf("a[%d]:%d\n", i, a[i]); 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /testsuite/Loops/cfg_loop_popcnt.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | unsigned cfg_loop_popcnt(unsigned n) __attribute__ ((noinline)); 9 | unsigned cfg_loop_popcnt(unsigned n) { 10 | unsigned int sum = 0, i; 11 | for (i = 0; i < 32; i++) { 12 | sum += (n) & 1; 13 | n /= 2; 14 | } 15 | return sum; 16 | } 17 | #ifdef __cplusplus 18 | } 19 | #endif 20 | 21 | int main(int argc, char **argv) { 22 | unsigned i; 23 | for(i = 0; i < 16; ++i) { 24 | unsigned n = (unsigned) rand(); 25 | unsigned res = cfg_loop_popcnt(n); 26 | printf("popcount(%x):%d\n", n, res); 27 | } 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /testsuite/Loops/cfg_loop_sum.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | unsigned cfg_loop_sum(unsigned a[], unsigned n) __attribute__ ((noinline)); 9 | unsigned cfg_loop_sum(unsigned a[], unsigned n) { 10 | long i; 11 | unsigned r = 0; 12 | for (i = 0; i < n; ++i) 13 | r += a[i]; 14 | 15 | return r; 16 | } 17 | #ifdef __cplusplus 18 | } 19 | #endif 20 | 21 | int main(int argc, char **argv) { 22 | unsigned N = 5; 23 | unsigned a[N]; 24 | 25 | long i; 26 | for(i = 0; i < N; ++i) 27 | a[i] = (unsigned) rand(); 28 | 29 | unsigned r = cfg_loop_sum(a, N); 30 | 31 | printf("result:%d\n", r); 32 | 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /testsuite/Loops/cfg_loop_two_array.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #define N 32 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | void cfg_loop_two_array(unsigned a[], unsigned b[], long n) __attribute__ ((noinline)); 11 | void cfg_loop_two_array(unsigned a[], unsigned b[], long n) { 12 | long i; 13 | for(i=2; i < n; ++i){ 14 | a[i] =b[i-2] + 1; 15 | b[i] =a[i-2] + 2; 16 | } 17 | } 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | int main(int argc, char **argv) { 23 | unsigned a[N]; 24 | unsigned b[N]; 25 | 26 | long i; 27 | for(i = 0; i < N; ++i) { 28 | a[i] = (unsigned) rand(); 29 | b[i] = (unsigned) rand(); 30 | } 31 | 32 | cfg_loop_two_array(a, b, N); 33 | 34 | for(i = 0; i < N; ++i) 35 | printf("a[%d]:%d,b[%d]:%d\n", i, a[i], i, b[i]); 36 | 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /testsuite/Loops/cfg_loop_vb.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | void cfg_loop_vb(unsigned a[], unsigned n) __attribute__ ((noinline)); 9 | void cfg_loop_vb(unsigned a[], unsigned n) { 10 | long i; 11 | for (i = 0; i < n; ++i) 12 | a[i] = a[i + 2] + 3; 13 | } 14 | #ifdef __cplusplus 15 | } 16 | #endif 17 | 18 | int main(int argc, char **argv) { 19 | unsigned a[16]; 20 | 21 | long i; 22 | for(i = 0; i < 16; ++i) 23 | a[i] = (unsigned) i; 24 | 25 | cfg_loop_vb(a, 8); 26 | 27 | for(i = 0; i < 16; ++i) 28 | printf("a[%d]:%d\n", i, a[i]); 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /testsuite/Loops/loop_memop_fusing_mem_move_8bit.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #define N 2048 6 | char a[N]; 7 | char b[N]; 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | void loop_memop_fusing_mem_move_8bit() __attribute__ ((noinline)); 13 | void loop_memop_fusing_mem_move_8bit() { 14 | long i; 15 | for (i = 0; i < N; ++i) 16 | b[i] = a[i]; 17 | } 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | int main(int argc, char **argv) { 23 | 24 | long i; 25 | for(i = 0; i < N; ++i) 26 | a[i] = (unsigned) rand(); 27 | 28 | loop_memop_fusing_mem_move_8bit(); 29 | 30 | for(i = 0; i < N; ++i) 31 | printf("a[%d]:%d\n", i, b[i]); 32 | 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /testsuite/ModelSimGen.lua: -------------------------------------------------------------------------------- 1 | ModelsimGenTemplate = [=[ 2 | $('#')!/bin/bash 3 | PATH=~/altera/10.1/modelsim_ase/bin/:~/altera/modelsim_ase/bin/:$PATH 4 | vdel -lib work -all 5 | vlib work 6 | vlog +define+quartus_synthesis -sv $(RTLModuleName).v 7 | vlog -sv INTF_$(RTLModuleName).v 8 | sed -i -e 's//5/' DUT_TOP_tb.sv 9 | vlog -sv DUT_TOP_tb.sv 10 | vlog -sv BRAM.sv 11 | vsim -t 1ps work.DUT_TOP_tb -c -do "run -all;quit -f" 12 | 13 | ]=] 14 | 15 | ModelsimGenTemplatePostRoutedSim = [=[ 16 | $('#')!/bin/bash 17 | PATH=~/altera/10.1/modelsim_ase/bin/:~/altera/modelsim_ase/bin/:$PATH 18 | cd ./simulation/modelsim 19 | vdel -lib work -all 20 | vlib work 21 | vlog DUT_TOP.vo 22 | vlog -sv ../../DUT_TOP_tb.sv 23 | vsim -t 1ps -L cycloneii_ver work.DUT_TOP_tb -c -do "do DUT_TOP_dump_all_vcd_nodes.tcl;run ns;vcd flush;quit -f" 24 | 25 | ]=] 26 | 27 | Passes.ModelsimGen = { FunctionScript = [=[ 28 | if Functions[FuncInfo.Name] ~= nil then 29 | end 30 | ]=], GlobalScript =[=[ 31 | local preprocess = require "luapp" . preprocess 32 | 33 | local ModelDoFile = assert(io.open (MODELDOFILE, "w+")) 34 | 35 | local _, message = preprocess {input=ModelsimGenTemplate, output=ModelDoFile} 36 | if message ~= nil then print(message) end 37 | ModelDoFile:close() 38 | 39 | ModelDoFile = assert(io.open (MODELDOFILE .. "_post_routed", "w+")) 40 | local _, post_routed_message = preprocess {input=ModelsimGenTemplatePostRoutedSim, output=ModelDoFile} 41 | if post_routed_message ~= nil then print(post_routed_message) end 42 | ModelDoFile:close() 43 | ]=]} 44 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_sources *.cpp) 2 | foreach(test_source ${test_sources}) 3 | get_filename_component(file_name ${test_source} NAME_WE) 4 | add_test_cases(${file_name}) 5 | endforeach() 6 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/GV_promotion.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | unsigned GV1 = 11; 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | void GV_promotion(unsigned a[]) __attribute__ ((noinline)); 10 | void GV_promotion(unsigned a[]) { 11 | a[2] = 0; 12 | a[1] = 1; 13 | a[0] = GV1; 14 | } 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | 19 | int main(int argc, char **argv) { 20 | srand (16); 21 | 22 | unsigned a[3]; 23 | a[0] = rand(); 24 | a[1] = rand(); 25 | a[2] = rand(); 26 | 27 | GV_promotion(a); 28 | 29 | printf("result:%d,%d,%d\n", a[0], a[1], a[2]); 30 | 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/cfg_if.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | unsigned cfg_if(unsigned a, unsigned b) __attribute__ ((noinline)); 9 | unsigned cfg_if(unsigned a, unsigned b) { 10 | if (a > 0xf) 11 | return a; 12 | 13 | return a * 2 - b; 14 | } 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | 19 | int main(int argc, char **argv) { 20 | srand (16); 21 | 22 | long i; 23 | for(i = 0; i < 16; ++i) { 24 | unsigned a = (unsigned ) rand(); 25 | unsigned b = (unsigned ) rand(); 26 | unsigned res = cfg_if(a, b); 27 | printf("result:%d\n", res); 28 | } 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/cfg_if_else.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | unsigned cfg_if_else(unsigned a, unsigned b) __attribute__ ((noinline)); 9 | unsigned cfg_if_else(unsigned a, unsigned b) { 10 | if (a > 0xf) 11 | a += b + 1; 12 | else 13 | b -= 1; 14 | 15 | return a * 2 - b; 16 | } 17 | #ifdef __cplusplus 18 | } 19 | #endif 20 | 21 | int main(int argc, char **argv) { 22 | srand (16); 23 | 24 | long i; 25 | for(i = 0; i < 16; ++i) { 26 | unsigned a = (unsigned ) rand(); 27 | unsigned b = (unsigned ) rand(); 28 | unsigned res = cfg_if_else(a, b); 29 | printf("result:%d\n", res); 30 | } 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/cfg_nested_if_else.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | int cfg_nested_if_else(int zSign, int float_rounding_mode) __attribute__ ((noinline)); 9 | int cfg_nested_if_else(int zSign, int float_rounding_mode) { 10 | int roundingMode; 11 | int roundNearestEven; 12 | int roundIncrement; 13 | 14 | roundingMode = float_rounding_mode; 15 | roundNearestEven = (roundingMode == 0); 16 | roundIncrement = 0x200; 17 | if (!roundNearestEven) 18 | { 19 | if (roundingMode == 1) 20 | { 21 | roundIncrement = 0; 22 | } 23 | else 24 | { 25 | roundIncrement = 0x3FF; 26 | if (zSign) 27 | { 28 | if (roundingMode == 2) 29 | roundIncrement = 0; 30 | } 31 | else 32 | { 33 | if (roundingMode == 3) 34 | roundIncrement = 0; 35 | } 36 | } 37 | } 38 | 39 | return roundIncrement; 40 | } 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | int main(int argc, char **argv) { 46 | srand (16); 47 | 48 | long i; 49 | for(i = 0; i < 16; ++i) { 50 | int x = rand(); 51 | int y = rand(); 52 | printf("%d, %d, result:%d\n", x, y, cfg_nested_if_else(x, y)); 53 | } 54 | 55 | return 0; 56 | } 57 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/fu_bram.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | unsigned fu_bram(long offest) __attribute__ ((noinline)); 9 | unsigned fu_bram(long offest) { 10 | unsigned a[8] = {0, 1, 2, 3, 4, 5, 6, 7}; 11 | return a[offest & 0x7]; 12 | } 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | int main(int argc, char **argv) { 18 | srand (16); 19 | 20 | long i; 21 | long index; 22 | int x; 23 | for(i = 0; i < 16; ++i) { 24 | index = rand(); 25 | x = i & 0x7; 26 | printf("%d, %d, result:%d\n", i, x, fu_bram(i)); 27 | } 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/fu_bram_continuous_load.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | void fu_bram_continuous_load(unsigned p[]) __attribute__ ((noinline)); 9 | void fu_bram_continuous_load(unsigned p[]) { 10 | static unsigned a[8] = {0, 1, 2, 3, 4, 5, 6, 7}; 11 | unsigned x0 = a[p[0]] + 2 * a[p[1]] + 4 * a[p[2]] + 8 * a[p[3]] + 16 * a[4] + 32 * a[5] + 64 * a[6] + 64 * a[7]; 12 | p[0] = x0; 13 | } 14 | #ifdef __cplusplus 15 | } 16 | #endif 17 | 18 | int main(int argc, char **argv) { 19 | srand (16); 20 | unsigned a[32]; 21 | long i; 22 | long index; 23 | int x; 24 | for(i = 0; i < 32; ++i) { 25 | a[i] = i; 26 | } 27 | 28 | fu_bram_continuous_load(a); 29 | 30 | for(i = 0; i < 32; ++i) { 31 | printf("%d, result:%d\n", i, a[i]); 32 | } 33 | 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/implicit_global_code_motion_delay_insertion_0.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | unsigned implicit_global_code_motion_delay_insertion_0(unsigned *p) 9 | __attribute__ ((noinline)); 10 | unsigned implicit_global_code_motion_delay_insertion_0(unsigned *p) { 11 | unsigned a = 4, b = 8; 12 | 13 | b = p[a]; 14 | 15 | if (b > 0xf) p[a] = b; 16 | 17 | return p[b]; 18 | } 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | int main(int argc, char **argv) { 24 | srand (16); 25 | unsigned A[16]; 26 | 27 | long i; 28 | 29 | for (i = 0; i < 16; ++i) 30 | A[i] = i; 31 | 32 | for(i = 0; i < 16; ++i) { 33 | unsigned res = implicit_global_code_motion_delay_insertion_0(A); 34 | printf("result:%d\n", res); 35 | } 36 | 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/mem_unalign.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | int mem_unalign(char *a) __attribute__ ((noinline)); 9 | int mem_unalign(char *a) { return *(int *)(a + 1); } 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | int main(int argc, char **argv) { 15 | srand (16); 16 | 17 | int i; 18 | for(i = 0; i < 16; ++i) { 19 | long long a = rand(); 20 | printf("result:%d\n", mem_unalign((char*)&a)); 21 | } 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/memdep_alias.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | unsigned memdep_alias(unsigned a[], long offset) __attribute__ ((noinline)); 9 | unsigned memdep_alias(unsigned a[], long offset) { 10 | a[0] = (offset >> 3) + 4; 11 | 12 | unsigned res = a[offset] + 2; 13 | 14 | return res; 15 | } 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | int main(int argc, char **argv) { 21 | srand (16); 22 | 23 | unsigned a[1]; 24 | a[0] = rand(); 25 | 26 | unsigned res = memdep_alias(a, 0); 27 | printf("result:%d\n", res); 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/memdep_noalias.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | unsigned memdep_noalias(unsigned a[], long offset) __attribute__ ((noinline)); 9 | unsigned memdep_noalias(unsigned a[], long offset) { 10 | a[0] = (offset >> 3) + 4; 11 | 12 | unsigned res = a[2] + 2; 13 | 14 | return res; 15 | } 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | int main(int argc, char **argv) { 21 | srand (16); 22 | 23 | unsigned a[3]; 24 | a[0] = rand(); 25 | a[1] = rand(); 26 | a[2] = rand(); 27 | 28 | unsigned res = memdep_noalias(a, 0); 29 | printf("result:%d\n", res); 30 | 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_add.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | int op_add(int a, int b) __attribute__ ((noinline)); 9 | int op_add(int a, int b) { return a + b; } 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | int main(int argc, char **argv) { 15 | srand (16); 16 | 17 | int i; 18 | for(i = 0; i < 16; ++i) { 19 | int a = rand(); 20 | int b = rand(); 21 | printf("result:%d\n", op_add(a, b)); 22 | } 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_asr.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | int op_asr(int a, int b) __attribute__ ((noinline)); 9 | int op_asr(int a, int b) { return a >> (b & 0x1f); } 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | int main(int argc, char **argv) { 15 | srand (16); 16 | 17 | int i; 18 | for(i = 0; i < 16; ++i) 19 | printf("result:%d\n", op_asr(rand(), rand())); 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_continuous_ldint8.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | signed char op_continuous_ldint8(signed char a[]) __attribute__ ((noinline)); 9 | signed char op_continuous_ldint8(signed char a[]) { 10 | return a[0] + a[1] + a[2] + a[3] + a[4] + a[5] + a[6] + a[1] + a[8] + a[9] + a[10]; 11 | } 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | int main(int argc, char **argv) { 17 | srand (16); 18 | 19 | signed char a[32]; 20 | 21 | long i; 22 | for(i = 0; i < 32; ++i) { 23 | a[i] = (signed char) rand(); 24 | } 25 | 26 | signed char res = op_continuous_ldint8(a); 27 | printf("result:%d\n", res); 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_div.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | unsigned op_div(unsigned a, unsigned b) __attribute__ ((noinline)); 9 | unsigned op_div(unsigned a, unsigned b) { return a / b; } 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | int main(int argc, char **argv) { 15 | srand (16); 16 | 17 | int i; 18 | for(i = 0; i < 16; ++i) { 19 | unsigned a = rand(); 20 | unsigned b = rand(); 21 | if (b == 0) b = 1; 22 | printf("result:%d\n", op_div(a, b)); 23 | } 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_eq.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | int op_eq(int a, int b) __attribute__ ((noinline)); 9 | int op_eq(int a, int b) { return a == b; } 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | int main(int argc, char **argv) { 15 | srand (16); 16 | 17 | int i; 18 | for(i = 0; i < 16; ++i) { 19 | int a = rand(); 20 | int b = rand(); 21 | printf("%x > %x -> result:%d\n", a, b, op_eq(a, b)); 22 | } 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_ldint16.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | signed short op_ldint16(signed short a[], long offest) __attribute__ ((noinline)); 9 | signed short op_ldint16(signed short a[], long offest) { return a[offest]; } 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | int main(int argc, char **argv) { 15 | srand (16); 16 | 17 | signed short a[16]; 18 | 19 | long i; 20 | for(i = 0; i < 16; ++i) { 21 | a[i] = (signed short) rand(); 22 | signed short res = op_ldint16(a, i); 23 | printf("result:%d\n", res); 24 | } 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_ldint32.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | signed int op_ldint32(signed int a[], long offest) __attribute__ ((noinline)); 9 | signed int op_ldint32(signed int a[], long offest) { return a[offest]; } 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | int main(int argc, char **argv) { 15 | srand (16); 16 | 17 | signed int a[16]; 18 | 19 | long i; 20 | for(i = 0; i < 16; ++i) { 21 | a[i] = (signed int) rand(); 22 | signed int res = op_ldint32(a, i); 23 | printf("result:%d\n", res); 24 | } 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_ldint64.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | signed long op_ldint64(signed long a[], long offest) __attribute__ ((noinline)); 9 | signed long op_ldint64(signed long a[], long offest) { return a[offest]; } 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | int main(int argc, char **argv) { 15 | srand (16); 16 | 17 | signed long a[16]; 18 | 19 | long i; 20 | for(i = 0; i < 16; ++i) { 21 | a[i] = (signed long) rand(); 22 | signed long res = op_ldint64(a, i); 23 | printf("result:%d\n", res); 24 | } 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_ldint8.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | signed char op_ldint8(signed char a[], long offest) __attribute__ ((noinline)); 9 | signed char op_ldint8(signed char a[], long offest) { return a[offest]; } 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | int main(int argc, char **argv) { 15 | srand (16); 16 | 17 | signed char a[16]; 18 | 19 | long i; 20 | for(i = 0; i < 16; ++i) { 21 | a[i] = (signed char) rand(); 22 | signed char res = op_ldint8(a, i); 23 | printf("result:%x\n", res); 24 | } 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_lduint16.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | unsigned short op_lduint16(unsigned short a[], long offest) __attribute__ ((noinline)); 9 | unsigned short op_lduint16(unsigned short a[], long offest) { return a[offest]; } 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | int main(int argc, char **argv) { 15 | srand (16); 16 | 17 | unsigned short a[16]; 18 | 19 | long i; 20 | for(i = 0; i < 16; ++i) { 21 | a[i] = (unsigned short) rand(); 22 | unsigned short res = op_lduint16(a, i); 23 | printf("result:%d\n", res); 24 | } 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_lduint32.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | unsigned int op_lduint32(unsigned int a[], long offest) __attribute__ ((noinline)); 9 | unsigned int op_lduint32(unsigned int a[], long offest) { return a[offest]; } 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | int main(int argc, char **argv) { 15 | srand (16); 16 | 17 | unsigned int a[16]; 18 | 19 | long i; 20 | for(i = 0; i < 16; ++i) { 21 | a[i] = (unsigned int) rand(); 22 | unsigned int res = op_lduint32(a, i); 23 | printf("result:%d\n", res); 24 | } 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_lduint64.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | unsigned long op_lduint64(unsigned long a[], long offest) __attribute__ ((noinline)); 9 | unsigned long op_lduint64(unsigned long a[], long offest) { return a[offest]; } 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | int main(int argc, char **argv) { 15 | srand (16); 16 | 17 | unsigned long a[16]; 18 | 19 | long i; 20 | for(i = 0; i < 16; ++i) { 21 | a[i] = (unsigned long) rand(); 22 | unsigned long res = op_lduint64(a, i); 23 | printf("result:%d\n", res); 24 | } 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_lduint8.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | unsigned char op_lduint8(unsigned char a[], long offest) __attribute__ ((noinline)); 9 | unsigned char op_lduint8(unsigned char a[], long offest) { return a[offest]; } 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | int main(int argc, char **argv) { 15 | srand (16); 16 | 17 | unsigned char a[16]; 18 | 19 | long i; 20 | for(i = 0; i < 16; ++i) { 21 | a[i] = (unsigned char) rand(); 22 | unsigned char res = op_lduint8(a, i); 23 | printf("result:%d\n", res); 24 | } 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_lsr.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | unsigned op_lsr(unsigned a, unsigned b) __attribute__ ((noinline)); 9 | unsigned op_lsr(unsigned a, unsigned b) { return a >> b; } 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | int main(int argc, char **argv) { 15 | srand (16); 16 | 17 | int i; 18 | for(i = 0; i < 16; ++i) 19 | printf("result:%d\n", op_lsr(rand(), rand())); 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_mult.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | int op_mult(int a, int b) __attribute__ ((noinline)); 9 | int op_mult(int a, int b) { return a * b; } 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | int main(int argc, char **argv) { 15 | srand (16); 16 | 17 | int i; 18 | for(i = 0; i < 16; ++i) { 19 | int a = rand(); 20 | int b = rand(); 21 | printf("result:%d\n", op_mult(a, b)); 22 | } 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_mult_folding.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | int op_mult_folding(int a) __attribute__ ((noinline)); 9 | int op_mult_folding(int a) { return a * 0x30; } 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | int main(int argc, char **argv) { 15 | srand (16); 16 | 17 | int i; 18 | for(i = 0; i < 16; ++i) { 19 | int a = rand(); 20 | printf("result:%d\n", op_mult_folding(a)); 21 | } 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_ne.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | int op_ne(int a, int b) __attribute__ ((noinline)); 9 | int op_ne(int a, int b) { return a != b; } 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | int main(int argc, char **argv) { 15 | srand (16); 16 | 17 | int i; 18 | for(i = 0; i < 16; ++i) { 19 | int a = rand(); 20 | int b = rand(); 21 | printf("%x > %x -> result:%d\n", a, b, op_ne(a, b)); 22 | } 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_or.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | int op_or(int a, int b) __attribute__ ((noinline)); 9 | int op_or(int a, int b) { return a | b; } 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | int main(int argc, char **argv) { 15 | srand (16); 16 | 17 | int i; 18 | for(i = 0; i < 16; ++i) 19 | printf("result:%d\n", op_or(rand(), rand())); 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_sel.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | unsigned op_sel(unsigned a, unsigned b, unsigned c) __attribute__ ((noinline)); 9 | unsigned op_sel(unsigned a, unsigned b, unsigned c) { 10 | return a ? b : c; 11 | } 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | int main(int argc, char **argv) { 17 | srand (16); 18 | 19 | long i; 20 | for(i = 0; i < 16; ++i) 21 | printf("result:%d\n", op_sel(rand(), 0, 0xffff)); 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_sge.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | int op_sge(int a, int b) __attribute__ ((noinline)); 9 | int op_sge(int a, int b) { return a >= b; } 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | int main(int argc, char **argv) { 15 | srand (16); 16 | 17 | int i; 18 | for(i = 0; i < 16; ++i) { 19 | int a = rand(); 20 | int b = rand(); 21 | printf("%x > %x -> result:%d\n", a, b, op_sge(a, b)); 22 | } 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_sgt.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | int op_sgt(int a, int b) __attribute__ ((noinline)); 9 | int op_sgt(int a, int b) { return a > b; } 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | int main(int argc, char **argv) { 15 | srand (16); 16 | 17 | int i; 18 | for(i = 0; i < 16; ++i) { 19 | int a = rand(); 20 | int b = rand(); 21 | printf("%x > %x -> result:%d\n", a, b, op_sgt(a, b)); 22 | } 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_shift.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | int op_shift(int a) __attribute__ ((noinline)); 9 | int op_shift(int a) { return a >> 4; } 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | int main(int argc, char **argv) { 15 | srand (16); 16 | 17 | int i; 18 | for(i = 0; i < 16; ++i) { 19 | int a = rand(); 20 | printf("%x -> result:%d\n", a, op_shift(a)); 21 | } 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_shl.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | int op_shl(long long int a, long long int b) __attribute__ ((noinline)); 9 | int op_shl(long long int a, long long int b) { return a << b; } 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | int main(int argc, char **argv) { 15 | srand (16); 16 | 17 | int i; 18 | for(i = 0; i < 16; ++i) { 19 | long long int a = rand(); 20 | long long int b = rand(); 21 | printf("%x >>> %x -> result:%d\n", a, b, op_shl(a, b)); 22 | } 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_sle.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | int op_sle(int a, int b) __attribute__ ((noinline)); 9 | int op_sle(int a, int b) { return a <= b; } 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | int main(int argc, char **argv) { 15 | srand (16); 16 | 17 | int i; 18 | for(i = 0; i < 16; ++i) { 19 | int a = rand(); 20 | int b = rand(); 21 | printf("%x > %x -> result:%d\n", a, b, op_sle(a, b)); 22 | } 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_slt.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | int op_slt(int a, int b) __attribute__ ((noinline)); 9 | int op_slt(int a, int b) { return a < b; } 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | int main(int argc, char **argv) { 15 | srand (16); 16 | 17 | int i; 18 | for(i = 0; i < 16; ++i) { 19 | int a = rand(); 20 | int b = rand(); 21 | printf("%x > %x -> result:%d\n", a, b, op_slt(a, b)); 22 | } 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_stint16.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | void op_stint16(signed short a[], long offest, signed short v) __attribute__ ((noinline)); 9 | void op_stint16(signed short a[], long offest, signed short v) { 10 | a[offest] = v; 11 | } 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | int main(int argc, char **argv) { 17 | srand (16); 18 | 19 | signed short a[16]; 20 | 21 | long i; 22 | for(i = 0; i < 16; ++i) { 23 | signed short v = (signed short) rand(); 24 | op_stint16(a, i, v); 25 | printf("result:%d\n", a[i]); 26 | } 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_stint32.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | void op_stint32(signed int a[], long offest, signed int v) __attribute__ ((noinline)); 9 | void op_stint32(signed int a[], long offest, signed int v) { 10 | a[offest] = v; 11 | } 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | int main(int argc, char **argv) { 17 | srand (16); 18 | 19 | signed int a[16]; 20 | 21 | long i; 22 | for(i = 0; i < 16; ++i) { 23 | signed int v = (signed int) rand(); 24 | op_stint32(a, i, v); 25 | printf("result:%d\n", a[i]); 26 | } 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_stint64.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | void op_stint64(signed long a[], long offest, signed long v) __attribute__ ((noinline)); 9 | void op_stint64(signed long a[], long offest, signed long v) { 10 | a[offest] = v; 11 | } 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | int main(int argc, char **argv) { 17 | srand (16); 18 | 19 | signed long a[16]; 20 | 21 | long i; 22 | for(i = 0; i < 16; ++i) { 23 | signed long v = (signed long) rand(); 24 | op_stint64(a, i, v); 25 | printf("result:%d\n", a[i]); 26 | } 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_stint8.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | void op_stint8(signed char a[], long offest, signed char v) __attribute__ ((noinline)); 9 | void op_stint8(signed char a[], long offest, signed char v) { 10 | a[offest] = v; 11 | } 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | int main(int argc, char **argv) { 17 | srand (16); 18 | 19 | signed char a[16]; 20 | 21 | long i; 22 | for(i = 0; i < 16; ++i) { 23 | signed char v = (signed char) rand(); 24 | op_stint8(a, i, v); 25 | printf("result:%d\n", a[i]); 26 | } 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_stuint16.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | void op_stuint16(unsigned short a[], long offest, unsigned short v) __attribute__ ((noinline)); 9 | void op_stuint16(unsigned short a[], long offest, unsigned short v) { 10 | a[offest] = v; 11 | } 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | int main(int argc, char **argv) { 17 | srand (16); 18 | 19 | unsigned short a[16]; 20 | 21 | long i; 22 | for(i = 0; i < 16; ++i) { 23 | unsigned short v = (unsigned short) rand(); 24 | op_stuint16(a, i, v); 25 | printf("result:%d\n", a[i]); 26 | } 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_stuint32.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | void op_stuint32(unsigned int a[], long offest, unsigned int v) __attribute__ ((noinline)); 9 | void op_stuint32(unsigned int a[], long offest, unsigned int v) { 10 | a[offest] = v; 11 | } 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | int main(int argc, char **argv) { 17 | srand (16); 18 | 19 | unsigned int a[16]; 20 | 21 | long i; 22 | for(i = 0; i < 16; ++i) { 23 | unsigned int v = (unsigned int) rand(); 24 | op_stuint32(a, i, v); 25 | printf("result:%d\n", a[i]); 26 | } 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_stuint64.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | void op_stuint64(unsigned long a[], long offest, unsigned long v) __attribute__ ((noinline)); 9 | void op_stuint64(unsigned long a[], long offest, unsigned long v) { 10 | a[offest] = v; 11 | } 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | int main(int argc, char **argv) { 17 | srand (16); 18 | 19 | unsigned long a[16]; 20 | 21 | long i; 22 | for(i = 0; i < 16; ++i) { 23 | unsigned long v = (unsigned long) rand(); 24 | op_stuint64(a, i, v); 25 | printf("result:%d\n", a[i]); 26 | } 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_stuint8.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | void op_stuint8(unsigned char a[], long offest, unsigned char v) __attribute__ ((noinline)); 9 | void op_stuint8(unsigned char a[], long offest, unsigned char v) { 10 | a[offest] = v; 11 | } 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | int main(int argc, char **argv) { 17 | srand (16); 18 | 19 | unsigned char a[16]; 20 | 21 | long i; 22 | for(i = 0; i < 16; ++i) { 23 | unsigned char v = (unsigned char) rand(); 24 | op_stuint8(a, i, v); 25 | printf("result:%d\n", a[i]); 26 | } 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_sub.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | int op_sub(int a, int b) __attribute__ ((noinline)); 9 | int op_sub(int a, int b) { return a - b; } 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | int main(int argc, char **argv) { 15 | srand (16); 16 | 17 | int i; 18 | for(i = 0; i < 16; ++i) { 19 | int a = rand(); 20 | int b = rand(); 21 | printf("result:%x\n", op_sub(a, b)); 22 | } 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_uge.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | int op_uge(unsigned a, unsigned b) __attribute__ ((noinline)); 9 | int op_uge(unsigned a, unsigned b) { return a >= b; } 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | int main(int argc, char **argv) { 15 | srand (16); 16 | 17 | int i; 18 | for(i = 0; i < 16; ++i) { 19 | unsigned a = rand(); 20 | unsigned b = rand(); 21 | printf("%x > %x -> result:%d\n", a, b, op_uge(a, b)); 22 | } 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_ugt.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | int op_ugt(unsigned a, unsigned b) __attribute__ ((noinline)); 9 | int op_ugt(unsigned a, unsigned b) { return a > b; } 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | int main(int argc, char **argv) { 15 | srand (16); 16 | 17 | int i; 18 | for(i = 0; i < 16; ++i) { 19 | unsigned a = rand(); 20 | unsigned b = rand(); 21 | printf("%x > %x -> result:%d\n", a, b, op_ugt(a, b)); 22 | } 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_ule.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | int op_ule(unsigned a, unsigned b) __attribute__ ((noinline)); 9 | int op_ule(unsigned a, unsigned b) { return a <= b; } 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | int main(int argc, char **argv) { 15 | srand (16); 16 | 17 | int i; 18 | for(i = 0; i < 16; ++i) { 19 | unsigned a = rand(); 20 | unsigned b = rand(); 21 | printf("%x > %x -> result:%d\n", a, b, op_ule(a, b)); 22 | } 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/op_ult.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | int op_ult(unsigned a, unsigned b) __attribute__ ((noinline)); 9 | int op_ult(unsigned a, unsigned b) { return a < b; } 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | int main(int argc, char **argv) { 15 | srand (16); 16 | 17 | int i; 18 | for(i = 0; i < 16; ++i) { 19 | unsigned a = rand(); 20 | unsigned b = rand(); 21 | printf("%x > %x -> result:%d\n", a, b, op_ult(a, b)); 22 | } 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/schedule_fu_conflict.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | void schedule_fu_conflict(unsigned a[]) __attribute__ ((noinline)); 9 | void schedule_fu_conflict(unsigned a[]) { 10 | a[2] = 0; 11 | a[1] = 1; 12 | } 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | int main(int argc, char **argv) { 18 | srand (16); 19 | 20 | unsigned a[3]; 21 | a[0] = rand(); 22 | a[1] = rand(); 23 | a[2] = rand(); 24 | 25 | schedule_fu_conflict(a); 26 | 27 | printf("result:%d,%d\n", a[1], a[2]); 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/sim_memcpy.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | unsigned a[128]; 8 | unsigned b[128]; 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | void sim_memcpy(unsigned char v) __attribute__ ((noinline)); 14 | void sim_memcpy(unsigned char v) { 15 | memcpy(a, b, sizeof(a)); 16 | } 17 | #ifdef __cplusplus 18 | } 19 | #endif 20 | 21 | int main(int argc, char **argv) { 22 | long i; 23 | for(i = 0; i < 128; ++i) 24 | a[i] = i; 25 | 26 | sim_memcpy(128); 27 | 28 | for(i = 0; i < 128; ++i) 29 | printf("a[%d]:%d\n", i, b[i]); 30 | 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/sim_memcpy_complex.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | unsigned a[128]; 8 | unsigned b[128]; 9 | unsigned c[128]; 10 | unsigned d = 1; 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | unsigned sim_memcpy_complex(unsigned char v, unsigned * pointer) __attribute__ ((noinline)); 15 | unsigned sim_memcpy_complex(unsigned char v, unsigned * pointer) { 16 | memcpy(a, b, sizeof(a)); 17 | memcpy(c, b, sizeof(c)); 18 | unsigned d = *pointer; 19 | return d; 20 | } 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | 25 | int main(int argc, char **argv) { 26 | long i; 27 | for(i = 0; i < 128; ++i) 28 | b[i] = i; 29 | unsigned *pointer =&d; 30 | //sim_memcpy(128); 31 | 32 | for(i = 0; i < 128; ++i){ 33 | unsigned m = sim_memcpy_complex(i, pointer); 34 | printf("a[%d]:%d\n", i, a[i]); 35 | printf("b[%d]:%d\n", i, b[i]); 36 | } 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/sim_memcpy_libcall_opt.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | unsigned a[128]; 8 | unsigned b[128]; 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | void sim_memcpy_libcall_opt(unsigned char v) __attribute__ ((noinline)); 14 | void sim_memcpy_libcall_opt(unsigned char v) { 15 | int i; 16 | for (i = 0; i < sizeof(a); ++i) 17 | b[i] = a[i]; 18 | } 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | int main(int argc, char **argv) { 24 | long i; 25 | for(i = 0; i < 128; ++i) 26 | a[i] = i; 27 | 28 | sim_memcpy_libcall_opt(128); 29 | 30 | for(i = 0; i < 128; ++i) 31 | printf("b[%d]:%d\n", i, b[i]); 32 | 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/sim_memmove.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | unsigned a[128]; 8 | unsigned b[128]; 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | void sim_memmove(unsigned char v) __attribute__ ((noinline)); 14 | void sim_memmove(unsigned char v) { 15 | memcpy(a, b, sizeof(a)); 16 | } 17 | #ifdef __cplusplus 18 | } 19 | #endif 20 | 21 | int main(int argc, char **argv) { 22 | long i; 23 | for(i = 0; i < 128; ++i) 24 | a[i] = i; 25 | 26 | sim_memmove(128); 27 | 28 | for(i = 0; i < 128; ++i) 29 | printf("a[%d]:%d\n", i, a[i]); 30 | 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/sim_memset.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | unsigned a[128]; 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | void sim_memset(unsigned char v) __attribute__ ((noinline)); 13 | void sim_memset(unsigned char v) { 14 | memset(a, v, sizeof(a)); 15 | } 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | int main(int argc, char **argv) { 21 | long i; 22 | sim_memset(128); 23 | 24 | for(i = 0; i < 128; ++i) 25 | printf("a[%d]:%d\n", i, a[i]); 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/sim_memset_complex.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | unsigned a[128]; 8 | unsigned b=1; 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | unsigned sim_memset_complex(unsigned char v,unsigned * pointer) __attribute__ ((noinline)); 13 | unsigned sim_memset_complex(unsigned char v,unsigned * pointer) { 14 | memset(a, v, sizeof(a)); 15 | unsigned c = *pointer; 16 | return c; 17 | } 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | int main(int argc, char **argv) { 23 | long i; 24 | unsigned * pointer =&b; 25 | for(i = 0; i < 128; ++i){ 26 | unsigned m = sim_memset_complex(i, pointer); 27 | printf("a[%d]:%d\n", i, a[i]); 28 | } 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /testsuite/SimpleTest/sub_module_non_memory_access.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | int sub_module(int a, int b) __attribute__ ((noinline)); 9 | int sub_module(int a, int b) { return a - b; } 10 | int sub_module_non_memory_access(int a, int b) __attribute__ ((noinline)); 11 | int sub_module_non_memory_access(int a, int b) { return (a + b) * sub_module(a, b); } 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | int main(int argc, char **argv) { 17 | srand (16); 18 | 19 | int i; 20 | for(i = 0; i < 16; ++i) { 21 | int a = rand(); 22 | int b = rand(); 23 | printf("result:%d\n", sub_module_non_memory_access(a, b)); 24 | } 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /testsuite/benchmark/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | macro(add_benchmark_stats name) 2 | set(TESTNAME ${name}_${PipelineType}_${ScheduleType}) 3 | add_dependencies(benchmark_report ${TESTNAME}_synthesis) 4 | add_dependencies(benchmark_test ${TESTNAME}_diff_output) 5 | 6 | get_filename_component(BASENAME ${CMAKE_CURRENT_BINARY_DIR} NAME) 7 | 8 | set(Benchmarks "${Benchmarks} ${BASENAME}/${TESTNAME}" PARENT_SCOPE) 9 | 10 | endmacro(add_benchmark_stats) 11 | 12 | macro(add_benchmark_symain_stats name) 13 | add_test_main_cases(${name}) 14 | set(TESTNAME ${name}_${PipelineType}_${ScheduleType}) 15 | add_dependencies(benchmark_synthesis_main ${TESTNAME}_synthesis_main) 16 | 17 | endmacro(add_benchmark_symain_stats) 18 | 19 | 20 | add_subdirectory(DSPStone) 21 | add_subdirectory(ChStone) 22 | -------------------------------------------------------------------------------- /testsuite/benchmark/ChStone/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ################################## 2 | #Add the banchmark of simple algorithm 3 | set(DP_ASAP TRUE) # pipeline_type = DontPipeline, schedule_type = ASAP 4 | set(ILPMS_ILP FALSE) # pipeline_type = ILPMS, schedule_tpye = ILP 5 | set(IMS_ASAP TRUE) # pipeline_type = IMS, schedule_type = ASAP 6 | 7 | add_subdirectory(dfadd) 8 | add_subdirectory(dfmul) 9 | add_subdirectory(dfdiv) 10 | add_subdirectory(dfsin) 11 | 12 | ################################## 13 | #Add the benchmark of encryption 14 | 15 | add_subdirectory(sha) 16 | add_subdirectory(aes) 17 | add_subdirectory(adpcm) 18 | add_subdirectory(blowfish) 19 | 20 | ################################## 21 | #Add the benchmark of other categories 22 | 23 | add_subdirectory(gsm) 24 | add_subdirectory(mips) 25 | add_subdirectory(jpeg) 26 | add_subdirectory(motion) 27 | 28 | #message(STATUS "Chstore Benchmarks : " ${Benchmarks}) 29 | 30 | -------------------------------------------------------------------------------- /testsuite/benchmark/ChStone/adpcm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_sources *.cpp) 2 | foreach(test_source ${test_sources}) 3 | get_filename_component(file_name ${test_source} NAME_WE) 4 | add_test_cases(${file_name}) 5 | endforeach() 6 | 7 | add_benchmark_stats("adpcm_main") 8 | add_benchmark_symain_stats("adpcm_main") 9 | -------------------------------------------------------------------------------- /testsuite/benchmark/ChStone/aes/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_sources *.cpp) 2 | foreach(test_source ${test_sources}) 3 | get_filename_component(file_name ${test_source} NAME_WE) 4 | add_test_cases(${file_name}) 5 | endforeach() 6 | 7 | add_benchmark_stats("aes_main") 8 | add_benchmark_symain_stats("aes_main") 9 | -------------------------------------------------------------------------------- /testsuite/benchmark/ChStone/blowfish/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_sources *.cpp) 2 | foreach(test_source ${test_sources}) 3 | get_filename_component(file_name ${test_source} NAME_WE) 4 | add_test_cases(${file_name}) 5 | endforeach() 6 | 7 | add_benchmark_stats("blowfish_main") 8 | add_benchmark_symain_stats("blowfish_main") 9 | 10 | -------------------------------------------------------------------------------- /testsuite/benchmark/ChStone/dfadd/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_sources *.cpp) 2 | foreach(test_source ${test_sources}) 3 | get_filename_component(file_name ${test_source} NAME_WE) 4 | add_test_cases(${file_name}) 5 | endforeach() 6 | 7 | add_benchmark_stats("float64_add") 8 | add_benchmark_symain_stats("float64_add") 9 | 10 | -------------------------------------------------------------------------------- /testsuite/benchmark/ChStone/dfdiv/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_sources *.cpp) 2 | foreach(test_source ${test_sources}) 3 | get_filename_component(file_name ${test_source} NAME_WE) 4 | add_test_cases(${file_name}) 5 | endforeach() 6 | 7 | add_benchmark_stats("float64_div") 8 | add_benchmark_symain_stats("float64_div") 9 | 10 | -------------------------------------------------------------------------------- /testsuite/benchmark/ChStone/dfmul/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_sources *.cpp) 2 | foreach(test_source ${test_sources}) 3 | get_filename_component(file_name ${test_source} NAME_WE) 4 | add_test_cases(${file_name}) 5 | endforeach() 6 | 7 | add_benchmark_stats("float64_mul") 8 | add_benchmark_symain_stats("float64_mul") 9 | -------------------------------------------------------------------------------- /testsuite/benchmark/ChStone/dfsin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_sources *.cpp) 2 | foreach(test_source ${test_sources}) 3 | get_filename_component(file_name ${test_source} NAME_WE) 4 | add_test_cases(${file_name}) 5 | endforeach() 6 | 7 | add_benchmark_stats("sin") 8 | add_benchmark_symain_stats("sin") 9 | 10 | -------------------------------------------------------------------------------- /testsuite/benchmark/ChStone/gsm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_sources *.cpp) 2 | foreach(test_source ${test_sources}) 3 | get_filename_component(file_name ${test_source} NAME_WE) 4 | add_test_cases(${file_name}) 5 | endforeach() 6 | 7 | add_benchmark_stats("Gsm_LPC_Analysis") 8 | add_benchmark_symain_stats("Gsm_LPC_Analysis") 9 | 10 | -------------------------------------------------------------------------------- /testsuite/benchmark/ChStone/jpeg/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_sources *.cpp) 2 | foreach(test_source ${test_sources}) 3 | get_filename_component(file_name ${test_source} NAME_WE) 4 | add_test_cases(${file_name}) 5 | endforeach() 6 | 7 | add_benchmark_stats("jpeg2bmp_main") 8 | add_benchmark_symain_stats("jpeg2bmp_main") 9 | -------------------------------------------------------------------------------- /testsuite/benchmark/ChStone/mips/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_sources *.cpp) 2 | foreach(test_source ${test_sources}) 3 | get_filename_component(file_name ${test_source} NAME_WE) 4 | add_test_cases(${file_name}) 5 | endforeach() 6 | 7 | add_benchmark_symain_stats("mips") 8 | -------------------------------------------------------------------------------- /testsuite/benchmark/ChStone/motion/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_sources *.cpp) 2 | foreach(test_source ${test_sources}) 3 | get_filename_component(file_name ${test_source} NAME_WE) 4 | add_test_cases(${file_name}) 5 | endforeach() 6 | 7 | add_benchmark_stats("motion_vectors") 8 | #add_benchmark_stats("Initialize_Buffer") 9 | add_benchmark_symain_stats("motion_vectors") 10 | 11 | -------------------------------------------------------------------------------- /testsuite/benchmark/ChStone/sha/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_sources *.cpp) 2 | foreach(test_source ${test_sources}) 3 | get_filename_component(file_name ${test_source} NAME_WE) 4 | add_test_cases(${file_name}) 5 | endforeach() 6 | 7 | add_benchmark_stats("sha_stream") 8 | add_benchmark_symain_stats("sha_stream") 9 | 10 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #Add the banchmark of simple algorithm 2 | add_subdirectory(complex_multiply) 3 | add_subdirectory(complex_update) 4 | add_subdirectory(convolution) 5 | add_subdirectory(dot_product) 6 | 7 | add_subdirectory(fft) 8 | add_subdirectory(fir) 9 | add_subdirectory(fir2dim) 10 | add_subdirectory(iir_biquad_N_sections) 11 | 12 | add_subdirectory(iir_biquad_one_section) 13 | add_subdirectory(lms) 14 | add_subdirectory(matrix) 15 | add_subdirectory(matrix1x3) 16 | 17 | add_subdirectory(n_complex_updates) 18 | add_subdirectory(n_real_updates) 19 | add_subdirectory(real_update) 20 | add_subdirectory(startup) 21 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/ad21/Makefile: -------------------------------------------------------------------------------- 1 | %.exe : %.s portab.h g721.h g721.c adsp2101.ach Makefile 2 | g21 $*.s -map -a adsp2101.ach -mstatic-spill\ 3 | -runhdr ${ADI_DSP}/21xx/lib/2101_hdr.obj -o $*.exe 4 | xsim2101 -w adsp2101.win -e $*.exe -a adsp2101& 5 | 6 | %.s : %.c 7 | g21 $*.c -Wall -S -D__ADSP2101__ -a adsp2101.ach 8 | 9 | %.ach : %.sys 10 | bld21 $* 11 | 12 | clean: 13 | rm -f *.cde *.i *.int *.is *.obj *.s *.exe 14 | 15 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/ad21/Makefile.tex: -------------------------------------------------------------------------------- 1 | \begin{verbatim} 2 | %.exe : %.s portab.h g721.h g721.c adsp2101.ach Makefile 3 | g21 $*.s -map -a adsp2101.ach -mstatic-spill\ 4 | -runhdr ${ADI_DSP}/21xx/lib/2101_hdr.obj -o $*.exe 5 | xsim2101 -w adsp2101.win -e $*.exe -a adsp2101& 6 | 7 | %.s : %.c 8 | g21 $*.c -Wall -S -D__ADSP2101__ -a adsp2101.ach 9 | 10 | %.ach : %.sys 11 | bld21 $* 12 | 13 | clean: 14 | rm -f *.cde *.i *.int *.is *.obj *.s *.exe 15 | \end{verbatim} -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/ad21/adsp2101.ach: -------------------------------------------------------------------------------- 1 | $ADPCM_SYSTEM 2 | $ADSP2101 3 | $MMAP0 4 | $0000 07FF paxINT_PMEM t 5 | $0800 17FF paxEXT_PMEM t 6 | $3800 3BFF dadINT_DMEM t 7 | $0800 2FFF dadEXT_DMEM t 8 | $ 9 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/ad21/adsp2101.sys: -------------------------------------------------------------------------------- 1 | .SYSTEM adpcm_system; 2 | .ADSP2101; 3 | .MMAP0; 4 | .SEG/PM/RAM/ABS=0/CODE/DATA int_pmem[2048]; 5 | .SEG/PM/RAM/ABS=2048/CODE/DATA ext_pmem[4096]; 6 | .SEG/DM/RAM/ABS=0x3800/DATA int_dmem[0x400]; 7 | .SEG/DM/RAM/ABS=0x800/DATA ext_dmem[0x2800]; 8 | .ENDSYS; 9 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/ad21/adsp2101.sys.tex: -------------------------------------------------------------------------------- 1 | \begin{verbatim} 2 | .SYSTEM adpcm_system; 3 | .ADSP2101; 4 | .MMAP0; 5 | .SEG/PM/RAM/ABS=0/CODE/DATA int_pmem[2048]; 6 | .SEG/PM/RAM/ABS=2048/CODE/DATA ext_pmem[4096]; 7 | .SEG/DM/RAM/ABS=0x3800/DATA int_dmem[0x400]; 8 | .SEG/DM/RAM/ABS=0x800/DATA ext_dmem[0x2800]; 9 | .ENDSYS; 10 | \end{verbatim} 11 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/ad21/adsp2101.win: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/testsuite/benchmark/DSPStone/adpcm/ad21/adsp2101.win -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/ad21/board_test.c: -------------------------------------------------------------------------------- 1 | #include "g721.h" 2 | 3 | U16BIT Input[] = 4 | { 5 | 0xff, 0xa7, 0x19, 0x92, 0x0f, 0x91, 0x18, 0xa3, 6 | 0x4d, 0x2b, 0x9a, 0x13, 0x8f, 0x11, 0x96, 0x20, 7 | 0xbe, 0xaf, 0x1c, 0x94, 0x10, 0x90, 0x15, 0x9e, 8 | 0x36, 0x36, 0x9e, 0x15, 0x90, 0x10, 0x94, 0x1c 9 | } ; 10 | 11 | #include "g721.c" 12 | 13 | int main(void) 14 | { 15 | int i; 16 | 17 | reset_encoder(); 18 | reset_decoder(); 19 | 20 | for (i = 0; i < sizeof(Input) / sizeof(U16BIT); i++) 21 | decoder(encoder(Input[i])); 22 | 23 | return (0); 24 | } 25 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/ad21/board_test.c.tex: -------------------------------------------------------------------------------- 1 | board\_test.c ; 2 | 3 | \begin{verbatim} 4 | #include "g721.h" 5 | 6 | U16BIT Input[] = 7 | { 8 | 0xff, 0xa7, 0x19, 0x92, 0x0f, 0x91, 0x18, 0xa3, 9 | 0x4d, 0x2b, 0x9a, 0x13, 0x8f, 0x11, 0x96, 0x20, 10 | 0xbe, 0xaf, 0x1c, 0x94, 0x10, 0x90, 0x15, 0x9e, 11 | 0x36, 0x36, 0x9e, 0x15, 0x90, 0x10, 0x94, 0x1c 12 | } ; 13 | 14 | #include "g721.c" 15 | 16 | int main(void) 17 | { 18 | int i; 19 | 20 | reset_encoder(); 21 | reset_decoder(); 22 | 23 | for (i = 0; i < sizeof(Input) / sizeof(U16BIT); i++) 24 | decoder(encoder(Input[i])); 25 | 26 | return (0); 27 | } 28 | \end{verbatim} 29 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/ad21/board_test.map: -------------------------------------------------------------------------------- 1 | 21XXlnk: board_test, global ___lib_prog_term declared in modules ADSP2101_Runtime_Header and ADSP2105_Runtime_Header (maybe others) 2 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/ad21/g721.h: -------------------------------------------------------------------------------- 1 | #ifndef __G721_H__ 2 | #define __G721_H__ 3 | 4 | #include "portab.h" 5 | 6 | #define u_LAW 0 7 | #define A_LAW 1 8 | 9 | extern int LAW; 10 | 11 | void reset_encoder(void); 12 | U16BIT encoder(U16BIT); 13 | 14 | void reset_decoder(void); 15 | U16BIT decoder(U16BIT); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/ad21/g721.h.tex: -------------------------------------------------------------------------------- 1 | g721.h : 2 | 3 | \begin{verbatim} 4 | #ifndef __G721_H__ 5 | #define __G721_H__ 6 | 7 | #include "portab.h" 8 | 9 | #define u_LAW 0 10 | #define A_LAW 1 11 | 12 | extern int LAW; 13 | 14 | void reset_encoder(void); 15 | U16BIT encoder(U16BIT); 16 | 17 | void reset_decoder(void); 18 | U16BIT decoder(U16BIT); 19 | 20 | #endif 21 | \end{verbatim} 22 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/ad21/portab.h: -------------------------------------------------------------------------------- 1 | #ifndef __PORTAB_H__ 2 | #define __PORTAB_H__ 3 | 4 | #define IF_ELSE(a,b,c) ((a) ? (b) : (c)) 5 | 6 | #if defined(__DSP5600x__) 7 | 8 | #define S16BIT int 9 | #define U16BIT unsigned int 10 | #define S24BIT int 11 | #define U24BIT unsigned int 12 | #define S32BIT long 13 | #define U32BIT unsigned long 14 | 15 | #elif defined(__ADSP2101__) || defined(__TMS320C50__) || \ 16 | defined(__DSP16xx__) || defined(__DSP56156__) || \ 17 | defined(__uPD77016__) 18 | 19 | #define S16BIT int 20 | #define U16BIT unsigned int 21 | #define S24BIT long 22 | #define U24BIT unsigned long 23 | #define S32BIT long 24 | #define U32BIT unsigned long 25 | 26 | #else 27 | 28 | #define S16BIT short 29 | #define U16BIT unsigned short 30 | #define S24BIT int 31 | #define U24BIT unsigned int 32 | #define S32BIT int 33 | #define U32BIT unsigned int 34 | /* 35 | #include "mocad.H" // use this with ObjectCenter only! 36 | */ 37 | #endif 38 | #endif 39 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/ad21/portab.h.tex: -------------------------------------------------------------------------------- 1 | portab.h : 2 | \begin{verbatim} 3 | #ifndef __PORTAB_H__ 4 | #define __PORTAB_H__ 5 | 6 | #define IF_ELSE(a,b,c) ((a) ? (b) : (c)) 7 | 8 | #if defined(__DSP5600x__) 9 | 10 | #define S16BIT int 11 | #define U16BIT unsigned int 12 | #define S24BIT int 13 | #define U24BIT unsigned int 14 | #define S32BIT long 15 | #define U32BIT unsigned long 16 | 17 | #elif defined(__ADSP2101__) || defined(__TMS320C50__) || \ 18 | defined(__DSP16xx__) || defined(__DSP56156__) || \ 19 | defined(__uPD77016__) 20 | 21 | #define S16BIT int 22 | #define U16BIT unsigned int 23 | #define S24BIT long 24 | #define U24BIT unsigned long 25 | #define S32BIT long 26 | #define U32BIT unsigned long 27 | 28 | #else 29 | 30 | #define S16BIT short 31 | #define U16BIT unsigned short 32 | #define S24BIT int 33 | #define U24BIT unsigned int 34 | #define S32BIT int 35 | #define U32BIT unsigned int 36 | /* 37 | #include "mocad.H" // use this with ObjectCenter only! 38 | */ 39 | #endif 40 | #endif 41 | \end{verbatim} 42 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/ad21/report.aux: -------------------------------------------------------------------------------- 1 | \relax 2 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/ad21/report.dvi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/testsuite/benchmark/DSPStone/adpcm/ad21/report.dvi -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/ad21/verify.c: -------------------------------------------------------------------------------- 1 | #include "g721.h" 2 | 3 | U16BIT Input[] = 4 | { 5 | 0xff, 0xa7, 0x19, 0x92, 0x0f, 0x91, 0x18, 0xa3, 6 | 0x4d, 0x2b, 0x9a, 0x13, 0x8f, 0x11, 0x96, 0x20, 7 | 0xbe, 0xaf, 0x1c, 0x94, 0x10, 0x90, 0x15, 0x9e, 8 | 0x36, 0x36, 0x9e, 0x15, 0x90, 0x10, 0x94, 0x1c 9 | } ; 10 | 11 | U16BIT Output[] = 12 | { 13 | 0xff, 0xf4, 0x70, 0xec, 0x68, 0xe0, 0x59, 0xcd, 14 | 0x4d, 0x4c, 0xaf, 0x14, 0x90, 0x12, 0x98, 0x1e, 15 | 0xbe, 0xb3, 0x1e, 0x92, 0x0f, 0x90, 0x15, 0xa1, 16 | 0x30, 0x3c, 0x9f, 0x15, 0x90, 0x11, 0x96, 0x1d 17 | } ; 18 | 19 | #include "g721.c" 20 | 21 | int main(void) 22 | { 23 | int i; 24 | U16BIT I; 25 | 26 | reset_encoder(); 27 | reset_decoder(); 28 | 29 | for (i = 0; i < sizeof(Input) / sizeof(U16BIT); i++) 30 | { 31 | I = encoder(Input[i]); 32 | if (decoder(I) != Output[i]) 33 | return (-1); 34 | } 35 | return (0); 36 | } 37 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/adpcm_c_nl/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for adpcm and test programs 3 | # ------------------- 4 | CFLAGS=-O 5 | # May need this on a sun: 6 | # CFLAGS=-O -I/usr/demo/SOUND 7 | 8 | ALLSRC=README adpcm.2 Makefile adpcm.h libst.h adpcm.c timing.c rawcaudio.c \ 9 | rawdaudio.c suncaudio.c sgicaudio.c sgidaudio.c hello.adpcm.uu 10 | 11 | all: adpcm.o rawcaudio rawdaudio timing 12 | 13 | sgi: all sgicaudio sgidaudio 14 | 15 | sun: all suncaudio sundaudio 16 | 17 | adpcm.o: adpcm.h 18 | 19 | suncaudio: suncaudio.o adpcm.o 20 | $(CC) adpcm.o suncaudio.o -o suncaudio -L/usr/demo/SOUND -laudio 21 | 22 | sundaudio: suncaudio 23 | cp suncaudio sundaudio 24 | 25 | sgicaudio: sgicaudio.o adpcm.o 26 | $(CC) sgicaudio.o adpcm.o -o sgicaudio -laudiofile -lm 27 | 28 | sgidaudio: sgidaudio.o adpcm.o 29 | $(CC) sgidaudio.o adpcm.o -o sgidaudio -laudiofile -lm 30 | 31 | rawcaudio: rawcaudio.o adpcm.o 32 | cc rawcaudio.o adpcm.o -o rawcaudio 33 | 34 | rawdaudio: rawdaudio.o adpcm.o 35 | cc rawdaudio.o adpcm.o -o rawdaudio 36 | 37 | timing: timing.o adpcm.o 38 | cc timing.o adpcm.o -o timing 39 | 40 | adpcm.shar: $(ALLSRC) 41 | shar $(ALLSRC) > adpcm.shar 42 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/adpcm_c_nl/adpcm.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** adpcm.h - include file for adpcm coder. 3 | ** 4 | ** Version 1.0, 7-Jul-92. 5 | */ 6 | 7 | struct adpcm_state { 8 | short valprev; /* Previous output value */ 9 | char index; /* Index into stepsize table */ 10 | }; 11 | 12 | #ifdef __STDC__ 13 | #define ARGS(x) x 14 | #else 15 | #define ARGS(x) () 16 | #endif 17 | 18 | void adpcm_coder ARGS((short [], char [], int, struct adpcm_state *)); 19 | void adpcm_decoder ARGS((char [], short [], int, struct adpcm_state *)); 20 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/adpcm_c_nl/adpcm.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/testsuite/benchmark/DSPStone/adpcm/adpcm_c_nl/adpcm.o -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/adpcm_c_nl/rawcaudio: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/testsuite/benchmark/DSPStone/adpcm/adpcm_c_nl/rawcaudio -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/adpcm_c_nl/rawcaudio.c: -------------------------------------------------------------------------------- 1 | /* testc - Test adpcm coder */ 2 | 3 | #include "adpcm.h" 4 | #include 5 | 6 | struct adpcm_state state; 7 | 8 | #define NSAMPLES 1000 9 | 10 | char abuf[NSAMPLES/2]; 11 | short sbuf[NSAMPLES]; 12 | 13 | main() { 14 | int n; 15 | 16 | while(1) { 17 | n = read(0, sbuf, NSAMPLES*2); 18 | if ( n < 0 ) { 19 | perror("input file"); 20 | exit(1); 21 | } 22 | if ( n == 0 ) break; 23 | adpcm_coder(sbuf, abuf, n/2, &state); 24 | write(1, abuf, n/4); 25 | } 26 | fprintf(stderr, "Final valprev=%d, index=%d\n", 27 | state.valprev, state.index); 28 | exit(0); 29 | } 30 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/adpcm_c_nl/rawcaudio.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/testsuite/benchmark/DSPStone/adpcm/adpcm_c_nl/rawcaudio.o -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/adpcm_c_nl/rawdaudio: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/testsuite/benchmark/DSPStone/adpcm/adpcm_c_nl/rawdaudio -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/adpcm_c_nl/rawdaudio.c: -------------------------------------------------------------------------------- 1 | /* testd - Test adpcm decoder */ 2 | 3 | #include "adpcm.h" 4 | #include 5 | 6 | struct adpcm_state state; 7 | 8 | #define NSAMPLES 1000 9 | 10 | char abuf[NSAMPLES/2]; 11 | short sbuf[NSAMPLES]; 12 | 13 | main() { 14 | int n; 15 | 16 | while(1) { 17 | n = read(0, abuf, NSAMPLES/2); 18 | if ( n < 0 ) { 19 | perror("input file"); 20 | exit(1); 21 | } 22 | if ( n == 0 ) break; 23 | adpcm_decoder(abuf, sbuf, n*2, &state); 24 | write(1, sbuf, n*4); 25 | } 26 | fprintf(stderr, "Final valprev=%d, index=%d\n", 27 | state.valprev, state.index); 28 | exit(0); 29 | } 30 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/adpcm_c_nl/rawdaudio.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/testsuite/benchmark/DSPStone/adpcm/adpcm_c_nl/rawdaudio.o -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/adpcm_c_nl/timing: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/testsuite/benchmark/DSPStone/adpcm/adpcm_c_nl/timing -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/adpcm_c_nl/timing.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Timing - Test timing on adpcm coder and decoder. 3 | ** 4 | ** The program creates 10Kb garbage, and runs the compressor and 5 | ** the decompressor on it. 6 | */ 7 | 8 | #include 9 | #include 10 | #include "adpcm.h" 11 | 12 | #define DATASIZE 10*1024 /* Data block size */ 13 | #define DURATION 10 /* How many seconds to measure */ 14 | 15 | short pcmdata[DATASIZE]; 16 | char adpcmdata[DATASIZE/2]; 17 | short pcmdata_2[DATASIZE]; 18 | 19 | struct adpcm_state coder_1_state, coder_2_state, decoder_state; 20 | 21 | main() { 22 | int i; 23 | int t0, t1, t2, t3; 24 | int count = 0, count2; 25 | 26 | for(i=0; i 0 ) { 41 | adpcm_coder(pcmdata, adpcmdata, DATASIZE, &coder_2_state); 42 | adpcm_decoder(adpcmdata, pcmdata_2, DATASIZE, &decoder_state); 43 | count2--; 44 | } 45 | t3 = time(0); 46 | printf("Decoder: %d Ksample/second\n", 47 | count*DATASIZE/(1000*(t3-t2-t1+t0))); 48 | printf(" (coded&decoded %d blocks of %d samples in %d seconds)\n", 49 | count, DATASIZE, t3-t2); 50 | exit(0); 51 | } 52 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/adpcm_c_nl/timing.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/testsuite/benchmark/DSPStone/adpcm/adpcm_c_nl/timing.o -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/board_test.c: -------------------------------------------------------------------------------- 1 | #include "g721.h" 2 | 3 | U16BIT Input[] = 4 | { 5 | 0xff, 0xa7, 0x19, 0x92, 0x0f, 0x91, 0x18, 0xa3, 6 | 0x4d, 0x2b, 0x9a, 0x13, 0x8f, 0x11, 0x96, 0x20, 7 | 0xbe, 0xaf, 0x1c, 0x94, 0x10, 0x90, 0x15, 0x9e, 8 | 0x36, 0x36, 0x9e, 0x15, 0x90, 0x10, 0x94, 0x1c 9 | } ; 10 | 11 | #include "g721.c" 12 | 13 | int main(void) 14 | { 15 | int i; 16 | 17 | reset_encoder(); 18 | reset_decoder(); 19 | 20 | for (i = 0; i < sizeof(Input) / sizeof(U16BIT); i++) 21 | decoder(encoder(Input[i])); 22 | 23 | return (0); 24 | } 25 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/board_test.c.tex: -------------------------------------------------------------------------------- 1 | board\_test.c ; 2 | 3 | \begin{verbatim} 4 | #include "g721.h" 5 | 6 | U16BIT Input[] = 7 | { 8 | 0xff, 0xa7, 0x19, 0x92, 0x0f, 0x91, 0x18, 0xa3, 9 | 0x4d, 0x2b, 0x9a, 0x13, 0x8f, 0x11, 0x96, 0x20, 10 | 0xbe, 0xaf, 0x1c, 0x94, 0x10, 0x90, 0x15, 0x9e, 11 | 0x36, 0x36, 0x9e, 0x15, 0x90, 0x10, 0x94, 0x1c 12 | } ; 13 | 14 | #include "g721.c" 15 | 16 | int main(void) 17 | { 18 | int i; 19 | 20 | reset_encoder(); 21 | reset_decoder(); 22 | 23 | for (i = 0; i < sizeof(Input) / sizeof(U16BIT); i++) 24 | decoder(encoder(Input[i])); 25 | 26 | return (0); 27 | } 28 | \end{verbatim} 29 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/c50/Makefile: -------------------------------------------------------------------------------- 1 | C50_DIR = /tools/home1/dsp/c50 2 | 3 | CC = $(C50_DIR)/dspcl 4 | LINKER = $(C50_DIR)/dsplnk 5 | 6 | board_test.exe : board_test.obj board_test.cmd 7 | $(LINKER) board_test.cmd 8 | sim5x board_test.exe & 9 | 10 | msb.exe : msb.obj msb.cmd 11 | $(LINKER) msb.cmd 12 | sim5x msb.exe & 13 | 14 | %.obj : %.c 15 | $(CC) $*.c -c -g -o2 -mn -k -s -as -v50 -d__TMS320C50__ 16 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/c50/Makefile.asm.tex: -------------------------------------------------------------------------------- 1 | Makefile (asm file): 2 | \begin{verbatim} 3 | C50_DIR = /tools/home1/dsp/c50 4 | 5 | CC = $(C50_DIR)/dspcl 6 | LINKER = $(C50_DIR)/dsplnk 7 | 8 | g72150.out : g72150.obj g72150.cmd Makefile 9 | $(LINKER) g72150.cmd 10 | sim5x g72150.out & 11 | 12 | %.obj : %.asm Makefile 13 | $(CC) -as $*.asm -v50 14 | 15 | %.asm : %.c 16 | $(CC) $*.c -c -g -o2 -mn -n -s -as -v50 17 | \end{verbatim} -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/c50/Makefile.tex: -------------------------------------------------------------------------------- 1 | Makefile (C file): 2 | \begin{verbatim} 3 | C50_DIR = /tools/home1/dsp/c50 4 | 5 | CC = $(C50_DIR)/dspcl 6 | LINKER = $(C50_DIR)/dsplnk 7 | 8 | board_test.exe : board_test.obj board_test.cmd 9 | $(LINKER) board_test.cmd 10 | sim5x board_test.exe & 11 | 12 | msb.exe : msb.obj msb.cmd 13 | $(LINKER) msb.cmd 14 | sim5x msb.exe & 15 | 16 | %.obj : %.c 17 | $(CC) $*.c -c -g -o2 -mn -k -s -as -v50 -d__TMS320C50__ 18 | \end{verbatim} 19 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/c50/asm.cfg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/testsuite/benchmark/DSPStone/adpcm/c50/asm.cfg -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/c50/board_test.c: -------------------------------------------------------------------------------- 1 | #include "g721.h" 2 | 3 | U16BIT Input[] = 4 | { 5 | 0xff, 0xa7, 0x19, 0x92, 0x0f, 0x91, 0x18, 0xa3, 6 | 0x4d, 0x2b, 0x9a, 0x13, 0x8f, 0x11, 0x96, 0x20, 7 | 0xbe, 0xaf, 0x1c, 0x94, 0x10, 0x90, 0x15, 0x9e, 8 | 0x36, 0x36, 0x9e, 0x15, 0x90, 0x10, 0x94, 0x1c 9 | } ; 10 | 11 | #include "g721.c" 12 | 13 | int main(void) 14 | { 15 | int i; 16 | 17 | reset_encoder(); 18 | reset_decoder(); 19 | 20 | for (i = 0; i < sizeof(Input) / sizeof(U16BIT); i++) 21 | decoder(encoder(Input[i])); 22 | 23 | return (0); 24 | } 25 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/c50/board_test.c.tex: -------------------------------------------------------------------------------- 1 | board\_test.c ; 2 | 3 | \begin{verbatim} 4 | #include "g721.h" 5 | 6 | U16BIT Input[] = 7 | { 8 | 0xff, 0xa7, 0x19, 0x92, 0x0f, 0x91, 0x18, 0xa3, 9 | 0x4d, 0x2b, 0x9a, 0x13, 0x8f, 0x11, 0x96, 0x20, 10 | 0xbe, 0xaf, 0x1c, 0x94, 0x10, 0x90, 0x15, 0x9e, 11 | 0x36, 0x36, 0x9e, 0x15, 0x90, 0x10, 0x94, 0x1c 12 | } ; 13 | 14 | #include "g721.c" 15 | 16 | int main(void) 17 | { 18 | int i; 19 | 20 | reset_encoder(); 21 | reset_decoder(); 22 | 23 | for (i = 0; i < sizeof(Input) / sizeof(U16BIT); i++) 24 | decoder(encoder(Input[i])); 25 | 26 | return (0); 27 | } 28 | \end{verbatim} 29 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/c50/board_test.cmd: -------------------------------------------------------------------------------- 1 | 2 | MEMORY 3 | { 4 | PAGE 0: 5 | ON_CHIP :origin=30h, length=1fd0h 6 | PAGE 1: 7 | REGS :origin=0h,length=60h 8 | SCRATCH_RAM :origin=60h,length=20h 9 | INT_DRAM :origin=100h,length=400h 10 | INT_SRAM :origin=800h,length=0400h 11 | EXT_RAM :origin=0c00h,length=0f400h 12 | } 13 | 14 | SECTIONS 15 | { 16 | .text : {} > ON_CHIP PAGE=0 17 | .cinit: {} > ON_CHIP PAGE=0 18 | .stack: {} > INT_DRAM PAGE=1 19 | .bss : {} > INT_DRAM PAGE=1 20 | .data : {} > EXT_RAM PAGE=1 21 | } 22 | 23 | board_test.obj 24 | -c 25 | -stack 100 26 | -m board_test.map 27 | -o board_test.exe 28 | -l /tools/home1/dsp/c50/rts50.lib 29 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/c50/board_test.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/testsuite/benchmark/DSPStone/adpcm/c50/board_test.exe -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/c50/board_test.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/testsuite/benchmark/DSPStone/adpcm/c50/board_test.obj -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/c50/g721.h: -------------------------------------------------------------------------------- 1 | #ifndef __G721_H__ 2 | #define __G721_H__ 3 | 4 | #include "portab.h" 5 | 6 | #define u_LAW 0 7 | #define A_LAW 1 8 | 9 | extern int LAW; 10 | 11 | void reset_encoder(void); 12 | U16BIT encoder(U16BIT); 13 | 14 | void reset_decoder(void); 15 | U16BIT decoder(U16BIT); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/c50/g721.h.tex: -------------------------------------------------------------------------------- 1 | g721.h : 2 | 3 | \begin{verbatim} 4 | #ifndef __G721_H__ 5 | #define __G721_H__ 6 | 7 | #include "portab.h" 8 | 9 | #define u_LAW 0 10 | #define A_LAW 1 11 | 12 | extern int LAW; 13 | 14 | void reset_encoder(void); 15 | U16BIT encoder(U16BIT); 16 | 17 | void reset_decoder(void); 18 | U16BIT decoder(U16BIT); 19 | 20 | #endif 21 | \end{verbatim} 22 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/c50/portab.h: -------------------------------------------------------------------------------- 1 | #ifndef __PORTAB_H__ 2 | #define __PORTAB_H__ 3 | 4 | #define IF_ELSE(a,b,c) ((a) ? (b) : (c)) 5 | 6 | #if defined(__DSP5600x__) 7 | 8 | #define S16BIT int 9 | #define U16BIT unsigned int 10 | #define S24BIT int 11 | #define U24BIT unsigned int 12 | #define S32BIT long 13 | #define U32BIT unsigned long 14 | 15 | #elif defined(__ADSP2101__) || defined(__TMS320C50__) || \ 16 | defined(__DSP16xx__) || defined(__DSP56156__) || \ 17 | defined(__uPD77016__) 18 | 19 | #define S16BIT int 20 | #define U16BIT unsigned int 21 | #define S24BIT long 22 | #define U24BIT unsigned long 23 | #define S32BIT long 24 | #define U32BIT unsigned long 25 | 26 | #else 27 | 28 | #define S16BIT short 29 | #define U16BIT unsigned short 30 | #define S24BIT int 31 | #define U24BIT unsigned int 32 | #define S32BIT int 33 | #define U32BIT unsigned int 34 | /* 35 | #include "mocad.H" // use this with ObjectCenter only! 36 | */ 37 | #endif 38 | #endif 39 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/c50/portab.h.tex: -------------------------------------------------------------------------------- 1 | portab.h : 2 | \begin{verbatim} 3 | #ifndef __PORTAB_H__ 4 | #define __PORTAB_H__ 5 | 6 | #define IF_ELSE(a,b,c) ((a) ? (b) : (c)) 7 | 8 | #if defined(__DSP5600x__) 9 | 10 | #define S16BIT int 11 | #define U16BIT unsigned int 12 | #define S24BIT int 13 | #define U24BIT unsigned int 14 | #define S32BIT long 15 | #define U32BIT unsigned long 16 | 17 | #elif defined(__ADSP2101__) || defined(__TMS320C50__) || \ 18 | defined(__DSP16xx__) || defined(__DSP56156__) || \ 19 | defined(__uPD77016__) 20 | 21 | #define S16BIT int 22 | #define U16BIT unsigned int 23 | #define S24BIT long 24 | #define U24BIT unsigned long 25 | #define S32BIT long 26 | #define U32BIT unsigned long 27 | 28 | #else 29 | 30 | #define S16BIT short 31 | #define U16BIT unsigned short 32 | #define S24BIT int 33 | #define U24BIT unsigned int 34 | #define S32BIT int 35 | #define U32BIT unsigned int 36 | /* 37 | #include "mocad.H" // use this with ObjectCenter only! 38 | */ 39 | #endif 40 | #endif 41 | \end{verbatim} 42 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/c50/report.aux: -------------------------------------------------------------------------------- 1 | \relax 2 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/c50/report.dvi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/testsuite/benchmark/DSPStone/adpcm/c50/report.dvi -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/c50/siminit.cmd: -------------------------------------------------------------------------------- 1 | ; Simulator Command File 2 | ; If you DONT WANT to use the SERIAL PORTS use the following map 3 | 4 | ma 0,0,0x10000,ram ; Allocate PROGRAM MEMORY 0 - 0xffff 5 | 6 | ma 0,1,0x80,ram ; Allocate DATA MEMORY 0 - 0x7f 7 | ; RESERVED DATA MEMORY 0x80 - 0xff 8 | ma 0x100,1,0x400,ram ; Allocate DATA MEMORY 0x100 - 0x4ff 9 | ; RESERVED DATA MEMORY 0x500 - 0x7ff 10 | ma 0x800,1,0xf800,ram ; Allocate DATA MEMORY 0x800 - 0xffff 11 | 12 | ; Sample Connect commands to connect Input and Output Files to the 13 | ; Serial Ports 14 | 15 | e *0x28=0 16 | e *0x29=0 17 | e *0x2a=0 18 | ;e *0x7=0x3eh 19 | 20 | ;fill 0x2000,1,0x800,0xff 21 | 22 | sconfig asm.cfg ; load own screen configuration 23 | wa clk 24 | 25 | 26 | mem 0x2000 27 | mem2 0x7e 28 | 29 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/c50/verify.c: -------------------------------------------------------------------------------- 1 | #include "g721.h" 2 | 3 | U16BIT Input[] = 4 | { 5 | 0xff, 0xa7, 0x19, 0x92, 0x0f, 0x91, 0x18, 0xa3, 6 | 0x4d, 0x2b, 0x9a, 0x13, 0x8f, 0x11, 0x96, 0x20, 7 | 0xbe, 0xaf, 0x1c, 0x94, 0x10, 0x90, 0x15, 0x9e, 8 | 0x36, 0x36, 0x9e, 0x15, 0x90, 0x10, 0x94, 0x1c 9 | } ; 10 | 11 | U16BIT Output[] = 12 | { 13 | 0xff, 0xf4, 0x70, 0xec, 0x68, 0xe0, 0x59, 0xcd, 14 | 0x4d, 0x4c, 0xaf, 0x14, 0x90, 0x12, 0x98, 0x1e, 15 | 0xbe, 0xb3, 0x1e, 0x92, 0x0f, 0x90, 0x15, 0xa1, 16 | 0x30, 0x3c, 0x9f, 0x15, 0x90, 0x11, 0x96, 0x1d 17 | } ; 18 | 19 | #include "g721.c" 20 | 21 | int main(void) 22 | { 23 | int i; 24 | U16BIT I; 25 | 26 | reset_encoder(); 27 | reset_decoder(); 28 | 29 | for (i = 0; i < sizeof(Input) / sizeof(U16BIT); i++) 30 | { 31 | I = encoder(Input[i]); 32 | if (decoder(I) != Output[i]) 33 | return (-1); 34 | } 35 | return (0); 36 | } 37 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/dsp56k/Makefile: -------------------------------------------------------------------------------- 1 | all: board_test.cld 2 | run56sim -t board_test.cld 3 | 4 | board_test.cld: board_test.cln g721.cln 5 | g56k board_test.cln g721.cln -o board_test.cld 6 | 7 | %.cln: %.c 8 | g56k -D__G56K__ -alo -c $*.c 9 | 10 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/dsp56k/Makefile.tex: -------------------------------------------------------------------------------- 1 | Makefile : 2 | 3 | \begin{verbatim} 4 | all: board_test.cld 5 | run56sim -t board_test.cld 6 | 7 | board_test.cld: board_test.cln g721.cln 8 | g56k board_test.cln g721.cln -o board_test.cld 9 | 10 | %.cln: %.c 11 | g56k -D__G56K__ -alo -c $*.c 12 | \end{verbatim} 13 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/dsp56k/board_test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "g721.h" 3 | 4 | U16BIT Input[] = 5 | { 6 | 0xff, 0xa7, 0x19, 0x92, 0x0f, 0x91, 0x18, 0xa3, 7 | 0x4d, 0x2b, 0x9a, 0x13, 0x8f, 0x11, 0x96, 0x20, 8 | 0xbe, 0xaf, 0x1c, 0x94, 0x10, 0x90, 0x15, 0x9e, 9 | 0x36, 0x36, 0x9e, 0x15, 0x90, 0x10, 0x94, 0x1c 10 | } ; 11 | 12 | extern int __time; 13 | 14 | int main(void) 15 | { 16 | int i, sic, eic; 17 | U16BIT I; 18 | 19 | reset_encoder(); 20 | reset_decoder(); 21 | 22 | sic = __time / 2; 23 | for (i = 0; i < sizeof(Input) / sizeof(U16BIT); i++) 24 | decoder(encoder(Input[i])); 25 | eic = __time / 2; 26 | printf("\nInstruction cycles for transcoding a sample: %d\n", 27 | (eic - sic) / (sizeof(Input) / sizeof(U16BIT))); 28 | 29 | return (0); 30 | } 31 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/dsp56k/board_test.c.tex: -------------------------------------------------------------------------------- 1 | board\_test.c : 2 | 3 | \begin{verbatim} 4 | #include 5 | #include "g721.h" 6 | 7 | U16BIT Input[] = 8 | { 9 | 0xff, 0xa7, 0x19, 0x92, 0x0f, 0x91, 0x18, 0xa3, 10 | 0x4d, 0x2b, 0x9a, 0x13, 0x8f, 0x11, 0x96, 0x20, 11 | 0xbe, 0xaf, 0x1c, 0x94, 0x10, 0x90, 0x15, 0x9e, 12 | 0x36, 0x36, 0x9e, 0x15, 0x90, 0x10, 0x94, 0x1c 13 | } ; 14 | 15 | extern int __time; 16 | 17 | int main(void) 18 | { 19 | int i, sic, eic; 20 | U16BIT I; 21 | 22 | reset_encoder(); 23 | reset_decoder(); 24 | 25 | sic = __time / 2; 26 | for (i = 0; i < sizeof(Input) / sizeof(U16BIT); i++) 27 | decoder(encoder(Input[i])); 28 | eic = __time / 2; 29 | printf("\nInstruction cycles for transcoding a sample: %d\n", 30 | (eic - sic) / (sizeof(Input) / sizeof(U16BIT))); 31 | 32 | return (0); 33 | } 34 | \end{verbatim} -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/dsp56k/board_test.cld: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/testsuite/benchmark/DSPStone/adpcm/dsp56k/board_test.cld -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/dsp56k/board_test.cln: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/testsuite/benchmark/DSPStone/adpcm/dsp56k/board_test.cln -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/dsp56k/g721.cln: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/testsuite/benchmark/DSPStone/adpcm/dsp56k/g721.cln -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/dsp56k/g721.h: -------------------------------------------------------------------------------- 1 | #ifndef __G721_H__ 2 | #define __G721_H__ 3 | 4 | #include "portab.h" 5 | 6 | #define u_LAW 0 7 | #define A_LAW 1 8 | 9 | extern int LAW; 10 | 11 | void reset_encoder(void); 12 | U16BIT encoder(U16BIT); 13 | 14 | void reset_decoder(void); 15 | U16BIT decoder(U16BIT); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/dsp56k/g721.h.tex: -------------------------------------------------------------------------------- 1 | g721.h: 2 | 3 | \begin{verbatim} 4 | #ifndef __G721_H__ 5 | #define __G721_H__ 6 | 7 | #include "portab.h" 8 | 9 | #define u_LAW 0 10 | #define A_LAW 1 11 | 12 | extern int LAW; 13 | 14 | void reset_encoder(void); 15 | U16BIT encoder(U16BIT); 16 | 17 | void reset_decoder(void); 18 | U16BIT decoder(U16BIT); 19 | 20 | #endif 21 | \end{verbatim} 22 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/dsp56k/mocad.H: -------------------------------------------------------------------------------- 1 | /* 2 | * Module for Overflow and CArry Detection 3 | * Use this module to simulate 16 or 24 Bit processors on a Workstation. 4 | * 5 | * Last modification: 24-Mar-94 Chris Schlaeger 6 | * 7 | * Beware: The ?: operator cannot be used in the usual way! (See portab.h) 8 | */ 9 | 10 | #ifndef __MOCAD_H__ 11 | #define __MOCAD_H__ 12 | 13 | #include 14 | 15 | #undef IF_ELSE 16 | #define IF_ELSE(a,b,c) ((a) ? (unsigned long) (b) : (unsigned long) (c)) 17 | 18 | class S16BIT 19 | { 20 | private: 21 | long value; 22 | long check(long); 23 | public: 24 | S16BIT(long v = 0) : value(check(v)) {} 25 | operator long&() { return value; } 26 | } ; 27 | 28 | class U16BIT 29 | { 30 | private: 31 | unsigned long value; 32 | unsigned long check(unsigned long); 33 | public: 34 | U16BIT(long v = 0) : value(check(v)) {} 35 | operator unsigned long&() { return value; } 36 | } ; 37 | 38 | class S24BIT 39 | { 40 | private: 41 | long value; 42 | long check(long); 43 | public: 44 | S24BIT(long v = 0) : value(check(v)) {} 45 | operator long&() { return value; } 46 | } ; 47 | 48 | class U24BIT 49 | { 50 | private: 51 | unsigned long value; 52 | unsigned long check(unsigned long); 53 | public: 54 | U24BIT(unsigned long v = 0) : value(check(v)) {} 55 | operator unsigned long&() { return value; } 56 | } ; 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/dsp56k/mocad.H.tex: -------------------------------------------------------------------------------- 1 | mocad.H : 2 | 3 | \begin{verbatim} 4 | /* 5 | * Module for Overflow and CArry Detection 6 | * Use this module to simulate 16 or 24 Bit processors on a Workstation. 7 | * 8 | * Last modification: 24-Mar-94 Chris Schlaeger 9 | * 10 | * Beware: The ?: operator cannot be used in the usual way! (See portab.h) 11 | */ 12 | 13 | #ifndef __MOCAD_H__ 14 | #define __MOCAD_H__ 15 | 16 | #include 17 | 18 | #undef IF_ELSE 19 | #define IF_ELSE(a,b,c) ((a) ? (unsigned long) (b) : (unsigned long) (c)) 20 | 21 | class S16BIT 22 | { 23 | private: 24 | long value; 25 | long check(long); 26 | public: 27 | S16BIT(long v = 0) : value(check(v)) {} 28 | operator long&() { return value; } 29 | } ; 30 | 31 | class U16BIT 32 | { 33 | private: 34 | unsigned long value; 35 | unsigned long check(unsigned long); 36 | public: 37 | U16BIT(long v = 0) : value(check(v)) {} 38 | operator unsigned long&() { return value; } 39 | } ; 40 | 41 | class S24BIT 42 | { 43 | private: 44 | long value; 45 | long check(long); 46 | public: 47 | S24BIT(long v = 0) : value(check(v)) {} 48 | operator long&() { return value; } 49 | } ; 50 | 51 | class U24BIT 52 | { 53 | private: 54 | unsigned long value; 55 | unsigned long check(unsigned long); 56 | public: 57 | U24BIT(unsigned long v = 0) : value(check(v)) {} 58 | operator unsigned long&() { return value; } 59 | } ; 60 | 61 | #endif 62 | \end{verbatim} 63 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/dsp56k/portab.h: -------------------------------------------------------------------------------- 1 | #ifndef __PORTAB_H__ 2 | #define __PORTAB_H__ 3 | 4 | #define IF_ELSE(a,b,c) ((a) ? (b) : (c)) 5 | 6 | #if defined(__G56K__) 7 | 8 | #define S16BIT int 9 | #define U16BIT unsigned int 10 | #define S24BIT int 11 | #define U24BIT unsigned int 12 | #define S32BIT long 13 | #define U32BIT unsigned long 14 | 15 | #elif defined(__G21__) || defined(_TMS320C50) 16 | 17 | #define S16BIT int 18 | #define U16BIT unsigned int 19 | #define S24BIT long 20 | #define U24BIT unsigned long 21 | #define S32BIT long 22 | #define U32BIT unsigned long 23 | 24 | #else 25 | 26 | /* 27 | #define S16BIT short 28 | #define U16BIT unsigned short 29 | #define S24BIT int 30 | #define U24BIT unsigned int 31 | #define S32BIT int 32 | #define U32BIT unsigned int 33 | */ 34 | #include "mocad.H" 35 | 36 | #endif 37 | #endif 38 | 39 | 40 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/dsp56k/portab.h.tex: -------------------------------------------------------------------------------- 1 | portab.h : 2 | 3 | \begin{verbatim} 4 | #ifndef __PORTAB_H__ 5 | #define __PORTAB_H__ 6 | 7 | #define IF_ELSE(a,b,c) ((a) ? (b) : (c)) 8 | 9 | #if defined(__G56K__) 10 | 11 | #define S16BIT int 12 | #define U16BIT unsigned int 13 | #define S24BIT int 14 | #define U24BIT unsigned int 15 | #define S32BIT long 16 | #define U32BIT unsigned long 17 | 18 | #elif defined(__G21__) || defined(_TMS320C50) 19 | 20 | #define S16BIT int 21 | #define U16BIT unsigned int 22 | #define S24BIT long 23 | #define U24BIT unsigned long 24 | #define S32BIT long 25 | #define U32BIT unsigned long 26 | 27 | #else 28 | 29 | /* 30 | #define S16BIT short 31 | #define U16BIT unsigned short 32 | #define S24BIT int 33 | #define U24BIT unsigned int 34 | #define S32BIT int 35 | #define U32BIT unsigned int 36 | */ 37 | #include "mocad.H" 38 | 39 | #endif 40 | #endif 41 | \end{verbatim} 42 | 43 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/dsp56k/report.aux: -------------------------------------------------------------------------------- 1 | \relax 2 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/dsp56k/report.dvi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/testsuite/benchmark/DSPStone/adpcm/dsp56k/report.dvi -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/dsp56k/verify.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "g721.h" 3 | 4 | U16BIT Input[] = 5 | { 6 | 0xff, 0xa7, 0x19, 0x92, 0x0f, 0x91, 0x18, 0xa3, 7 | 0x4d, 0x2b, 0x9a, 0x13, 0x8f, 0x11, 0x96, 0x20, 8 | 0xbe, 0xaf, 0x1c, 0x94, 0x10, 0x90, 0x15, 0x9e, 9 | 0x36, 0x36, 0x9e, 0x15, 0x90, 0x10, 0x94, 0x1c 10 | } ; 11 | 12 | U16BIT Output[] = 13 | { 14 | 0xff, 0xf4, 0x70, 0xec, 0x68, 0xe0, 0x59, 0xcd, 15 | 0x4d, 0x4c, 0xaf, 0x14, 0x90, 0x12, 0x98, 0x1e, 16 | 0xbe, 0xb3, 0x1e, 0x92, 0x0f, 0x90, 0x15, 0xa1, 17 | 0x30, 0x3c, 0x9f, 0x15, 0x90, 0x11, 0x96, 0x1d 18 | } ; 19 | 20 | extern int __time; 21 | 22 | int main(void) 23 | { 24 | int i, sic, eic; 25 | U16BIT I; 26 | 27 | reset_encoder(); 28 | reset_decoder(); 29 | 30 | sic = __time / 2; 31 | for (i = 0; i < sizeof(Input) / sizeof(U16BIT); i++) 32 | { 33 | U16BIT IX; 34 | 35 | I = encoder(Input[i]); 36 | if ((IX = decoder(I)) != Output[i]) 37 | { 38 | printf("\n*** TRANSCODE ERROR with sample No. %d!", i); 39 | printf("\n %d instead of %d received", IX, Output[i]); 40 | /* exit(-1); */ 41 | } 42 | } 43 | eic = __time / 2; 44 | printf("\nInstruction cycles for transcoding a sample: %d\n", 45 | (eic - sic) / (sizeof(Input) / sizeof(U16BIT))); 46 | 47 | return (0); 48 | } 49 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/g721.h: -------------------------------------------------------------------------------- 1 | #ifndef __G721_H__ 2 | #define __G721_H__ 3 | 4 | #include "portab.h" 5 | 6 | #define u_LAW 0 7 | #define A_LAW 1 8 | 9 | extern int LAW; 10 | 11 | void reset_encoder(void); 12 | U16BIT encoder(U16BIT); 13 | 14 | void reset_decoder(void); 15 | U16BIT decoder(U16BIT); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/g721.h.tex: -------------------------------------------------------------------------------- 1 | g721.h : 2 | 3 | \begin{verbatim} 4 | #ifndef __G721_H__ 5 | #define __G721_H__ 6 | 7 | #include "portab.h" 8 | 9 | #define u_LAW 0 10 | #define A_LAW 1 11 | 12 | extern int LAW; 13 | 14 | void reset_encoder(void); 15 | U16BIT encoder(U16BIT); 16 | 17 | void reset_decoder(void); 18 | U16BIT decoder(U16BIT); 19 | 20 | #endif 21 | \end{verbatim} 22 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/g721/DSP56k/Makefile: -------------------------------------------------------------------------------- 1 | all: board_test.cld 2 | run56sim -t board_test.cld 3 | 4 | board_test.cld: board_test.cln g721.cln 5 | g56k board_test.cln g721.cln -o board_test.cld 6 | 7 | %.cln: %.c 8 | g56k -D__G56K__ -alo -c $*.c 9 | 10 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/g721/DSP56k/SCCS/p.Makefile: -------------------------------------------------------------------------------- 1 | 1.1 1.2 schlaege 94/04/20 15:39:56 2 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/g721/DSP56k/SCCS/p.board_test.c: -------------------------------------------------------------------------------- 1 | 1.1 1.2 schlaege 94/04/20 15:53:02 2 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/g721/DSP56k/SCCS/s.Makefile: -------------------------------------------------------------------------------- 1 | h22194 2 | s 00009/00000/00000 3 | d D 1.1 94/04/20 14:51:53 dsp 1 0 4 | c date and time created 94/04/20 14:51:53 by dsp 5 | e 6 | u 7 | U 8 | f e 0 9 | t 10 | T 11 | I 1 12 | all: board_test.cld 13 | run56sim -t board_test.cld 14 | 15 | board_test.cld: board_test.cln g721.cln 16 | g56k board_test.cln g721.cln -o board_test.cld 17 | 18 | %.cln: %.c 19 | g56k -D__G56K__ -alo -c $*.c 20 | 21 | E 1 22 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/g721/DSP56k/SCCS/s.board_test.c: -------------------------------------------------------------------------------- 1 | h52492 2 | s 00030/00000/00000 3 | d D 1.1 94/04/20 14:52:08 dsp 1 0 4 | c date and time created 94/04/20 14:52:08 by dsp 5 | e 6 | u 7 | U 8 | f e 0 9 | t 10 | T 11 | I 1 12 | #include 13 | #include "g721.h" 14 | 15 | U16BIT Input[] = 16 | { 17 | 0xff, 0xa7, 0x19, 0x92, 0x0f, 0x91, 0x18, 0xa3, 18 | 0x4d, 0x2b, 0x9a, 0x13, 0x8f, 0x11, 0x96, 0x20, 19 | 0xbe, 0xaf, 0x1c, 0x94, 0x10, 0x90, 0x15, 0x9e, 20 | 0x36, 0x36, 0x9e, 0x15, 0x90, 0x10, 0x94, 0x1c 21 | } ; 22 | 23 | extern int __time; 24 | 25 | int main(void) 26 | { 27 | int i, sic, eic; 28 | U16BIT I; 29 | 30 | reset_encoder(); 31 | reset_decoder(); 32 | 33 | sic = __time / 2; 34 | for (i = 0; i < sizeof(Input) / sizeof(U16BIT); i++) 35 | decoder(encoder(Input[i])); 36 | eic = __time / 2; 37 | printf("\nInstruction cycles for transcoding a sample: %d\n", 38 | (eic - sic) / (sizeof(Input) / sizeof(U16BIT))); 39 | 40 | return (0); 41 | } 42 | E 1 43 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/g721/DSP56k/board_test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "g721.h" 3 | 4 | U16BIT Input[] = 5 | { 6 | 0xff, 0xa7, 0x19, 0x92, 0x0f, 0x91, 0x18, 0xa3, 7 | 0x4d, 0x2b, 0x9a, 0x13, 0x8f, 0x11, 0x96, 0x20, 8 | 0xbe, 0xaf, 0x1c, 0x94, 0x10, 0x90, 0x15, 0x9e, 9 | 0x36, 0x36, 0x9e, 0x15, 0x90, 0x10, 0x94, 0x1c 10 | } ; 11 | 12 | extern int __time; 13 | 14 | int main(void) 15 | { 16 | int i, sic, eic; 17 | U16BIT I; 18 | 19 | reset_encoder(); 20 | reset_decoder(); 21 | 22 | sic = __time / 2; 23 | for (i = 0; i < sizeof(Input) / sizeof(U16BIT); i++) 24 | decoder(encoder(Input[i])); 25 | eic = __time / 2; 26 | printf("\nInstruction cycles for transcoding a sample: %d\n", 27 | (eic - sic) / (sizeof(Input) / sizeof(U16BIT))); 28 | 29 | return (0); 30 | } 31 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/g721/DSP56k/g721.h: -------------------------------------------------------------------------------- 1 | #ifndef __G721_H__ 2 | #define __G721_H__ 3 | 4 | #include "portab.h" 5 | 6 | #define u_LAW 0 7 | #define A_LAW 1 8 | 9 | extern int LAW; 10 | 11 | void reset_encoder(void); 12 | U16BIT encoder(U16BIT); 13 | 14 | void reset_decoder(void); 15 | U16BIT decoder(U16BIT); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/g721/DSP56k/portab.h: -------------------------------------------------------------------------------- 1 | #ifndef __PORTAB_H__ 2 | #define __PORTAB_H__ 3 | 4 | #define IF_ELSE(a,b,c) ((a) ? (b) : (c)) 5 | 6 | #if defined(__G56K__) 7 | 8 | #define S16BIT int 9 | #define U16BIT unsigned int 10 | #define S24BIT int 11 | #define U24BIT unsigned int 12 | #define S32BIT long 13 | #define U32BIT unsigned long 14 | 15 | #elif defined(__G21__) || defined(_TMS320C50) 16 | 17 | #define S16BIT int 18 | #define U16BIT unsigned int 19 | #define S24BIT long 20 | #define U24BIT unsigned long 21 | #define S32BIT long 22 | #define U32BIT unsigned long 23 | 24 | #else 25 | 26 | /* 27 | #define S16BIT short 28 | #define U16BIT unsigned short 29 | #define S24BIT int 30 | #define U24BIT unsigned int 31 | #define S32BIT int 32 | #define U32BIT unsigned int 33 | */ 34 | #include "mocad.H" 35 | 36 | #endif 37 | #endif 38 | 39 | 40 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/g721/DSP56k/verify.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "g721.h" 3 | 4 | U16BIT Input[] = 5 | { 6 | 0xff, 0xa7, 0x19, 0x92, 0x0f, 0x91, 0x18, 0xa3, 7 | 0x4d, 0x2b, 0x9a, 0x13, 0x8f, 0x11, 0x96, 0x20, 8 | 0xbe, 0xaf, 0x1c, 0x94, 0x10, 0x90, 0x15, 0x9e, 9 | 0x36, 0x36, 0x9e, 0x15, 0x90, 0x10, 0x94, 0x1c 10 | } ; 11 | 12 | U16BIT Output[] = 13 | { 14 | 0xff, 0xf4, 0x70, 0xec, 0x68, 0xe0, 0x59, 0xcd, 15 | 0x4d, 0x4c, 0xaf, 0x14, 0x90, 0x12, 0x98, 0x1e, 16 | 0xbe, 0xb3, 0x1e, 0x92, 0x0f, 0x90, 0x15, 0xa1, 17 | 0x30, 0x3c, 0x9f, 0x15, 0x90, 0x11, 0x96, 0x1d 18 | } ; 19 | 20 | extern int __time; 21 | 22 | int main(void) 23 | { 24 | int i, sic, eic; 25 | U16BIT I; 26 | 27 | reset_encoder(); 28 | reset_decoder(); 29 | 30 | sic = __time / 2; 31 | for (i = 0; i < sizeof(Input) / sizeof(U16BIT); i++) 32 | { 33 | U16BIT IX; 34 | 35 | I = encoder(Input[i]); 36 | if ((IX = decoder(I)) != Output[i]) 37 | { 38 | printf("\n*** TRANSCODE ERROR with sample No. %d!", i); 39 | printf("\n %d instead of %d received", IX, Output[i]); 40 | /* exit(-1); */ 41 | } 42 | } 43 | eic = __time / 2; 44 | printf("\nInstruction cycles for transcoding a sample: %d\n", 45 | (eic - sic) / (sizeof(Input) / sizeof(U16BIT))); 46 | 47 | return (0); 48 | } 49 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/g721/SCCS/p.portab.h: -------------------------------------------------------------------------------- 1 | 1.3 1.4 schlaege 94/11/04 11:57:57 2 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/g721/SCCS/s.g721.h: -------------------------------------------------------------------------------- 1 | h24893 2 | s 00017/00000/00000 3 | d D 1.1 94/03/24 11:30:37 dsp 1 0 4 | c date and time created 94/03/24 11:30:37 by dsp 5 | e 6 | u 7 | U 8 | f e 0 9 | t 10 | T 11 | I 1 12 | #ifndef __G721_H__ 13 | #define __G721_H__ 14 | 15 | #include "portab.h" 16 | 17 | #define u_LAW 0 18 | #define A_LAW 1 19 | 20 | extern int LAW; 21 | 22 | void reset_encoder(void); 23 | U16BIT encoder(U16BIT); 24 | 25 | void reset_decoder(void); 26 | U16BIT decoder(U16BIT); 27 | 28 | #endif 29 | E 1 30 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/g721/g721.h: -------------------------------------------------------------------------------- 1 | #ifndef __G721_H__ 2 | #define __G721_H__ 3 | 4 | #include "portab.h" 5 | 6 | #define u_LAW 0 7 | #define A_LAW 1 8 | 9 | extern int LAW; 10 | 11 | void reset_encoder(void); 12 | U16BIT encoder(U16BIT); 13 | 14 | void reset_decoder(void); 15 | U16BIT decoder(U16BIT); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/g721/mocad.H: -------------------------------------------------------------------------------- 1 | /* 2 | * Module for Overflow and CArry Detection 3 | * Use this module to simulate 16 or 24 Bit processors on a Workstation. 4 | * 5 | * Last modification: 24-Mar-94 Chris Schlaeger 6 | * 7 | * Beware: The ?: operator cannot be used in the usual way! (See portab.h) 8 | */ 9 | 10 | #ifndef __MOCAD_H__ 11 | #define __MOCAD_H__ 12 | 13 | #include 14 | 15 | #undef IF_ELSE 16 | #define IF_ELSE(a,b,c) ((a) ? (unsigned long) (b) : (unsigned long) (c)) 17 | 18 | class S16BIT 19 | { 20 | private: 21 | long value; 22 | long check(long); 23 | public: 24 | S16BIT(long v = 0) : value(check(v)) {} 25 | operator long&() { return value; } 26 | } ; 27 | 28 | class U16BIT 29 | { 30 | private: 31 | unsigned long value; 32 | unsigned long check(unsigned long); 33 | public: 34 | U16BIT(long v = 0) : value(check(v)) {} 35 | operator unsigned long&() { return value; } 36 | } ; 37 | 38 | class S24BIT 39 | { 40 | private: 41 | long value; 42 | long check(long); 43 | public: 44 | S24BIT(long v = 0) : value(check(v)) {} 45 | operator long&() { return value; } 46 | } ; 47 | 48 | class U24BIT 49 | { 50 | private: 51 | unsigned long value; 52 | unsigned long check(unsigned long); 53 | public: 54 | U24BIT(unsigned long v = 0) : value(check(v)) {} 55 | operator unsigned long&() { return value; } 56 | } ; 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/g721/portab.h: -------------------------------------------------------------------------------- 1 | #ifndef __PORTAB_H__ 2 | #define __PORTAB_H__ 3 | 4 | #define IF_ELSE(a,b,c) ((a) ? (b) : (c)) 5 | 6 | #if defined(__G56K__) 7 | 8 | #define S16BIT int 9 | #define U16BIT unsigned int 10 | #define S24BIT int 11 | #define U24BIT unsigned int 12 | #define S32BIT long 13 | #define U32BIT unsigned long 14 | 15 | #elif defined(__G21__) || defined(_TMS320C50) 16 | 17 | #define S16BIT int 18 | #define U16BIT unsigned int 19 | #define S24BIT long 20 | #define U24BIT unsigned long 21 | #define S32BIT long 22 | #define U32BIT unsigned long 23 | 24 | #else 25 | 26 | /* 27 | #define S16BIT short 28 | #define U16BIT unsigned short 29 | #define S24BIT int 30 | #define U24BIT unsigned int 31 | #define S32BIT int 32 | #define U32BIT unsigned int 33 | */ 34 | #include "mocad.H" 35 | 36 | #endif 37 | #endif 38 | 39 | 40 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/README: -------------------------------------------------------------------------------- 1 | (1) total_count 2 | All files concerning the total instruction count, taking loops in account. 3 | 4 | (2) mnemonic count 5 | All files concerning a stright forward mnemonic count. 6 | Several versions 7 | i. opt_adpcm-v1.c, original CCITT algorithm C implementation (handwritten) 8 | ii. opt_adpcm-v2.c, first C optimization program (handwritten) 9 | iii.opt_adpcm-v3.c, Structs included (handwritten) 10 | iv. opt_adpcm-v4.c, Specific Code for the S56X Board (handwritten) 11 | v. opt_adpcm_call.c, DESCARTES Generated Code in call 12 | vi. opt_adpcm_inl.c, DESCARTES Generated Code in inline 13 | vii.adpcm.asm, MOTOROLA asm program (no expand/compress routines) -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/Makefile: -------------------------------------------------------------------------------- 1 | CC = CC 2 | 3 | %.exe: %.c 4 | $(CC) -o $*.exe $*.c 5 | $*.exe 6 | cmp -l data.out sample.out 7 | 8 | 9 | %.o : %.c 10 | $(CC) -c -g -Wall $*.c 11 | 12 | 13 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/adpcm-grp1.xg: -------------------------------------------------------------------------------- 1 | TitleText: Move & Transfer Distribution of adpcm-grp1.asm 2 | 2 95.76 3 | 4 4.24 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/adpcm.imc.xg: -------------------------------------------------------------------------------- 1 | Titletext: Immediate vs. Non Immediate Moves 2 | 1 47 3 | 3 227 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/adpcm.inf: -------------------------------------------------------------------------------- 1 | Titletext: Mnemonic analysis of adpcm.asm 2 | Grp 1 334 3 | Grp 2 94 4 | Grp 3 12 5 | Grp 4 72 6 | Grp 5 0 7 | Grp 6 337 8 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/adpcm.mmc.xg: -------------------------------------------------------------------------------- 1 | Titletext: Memory vs. Non Memory Moves of adpcm.asm 2 | 1 161 3 | 3 113 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/adpcm.mvc: -------------------------------------------------------------------------------- 1 | Titletext: Move analysis of adpcm.asm 2 | 1 260 3 | 2 11 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/adpcm.rmc.xg: -------------------------------------------------------------------------------- 1 | Titletext: Register Indirect vs. Register Direct Moves of adpcm.asm 2 | 1 100 3 | 3 174 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/adpcm.tfc: -------------------------------------------------------------------------------- 1 | Titletext: Move analysis of adpcm.asm 2 | 1 12 3 | 2 0 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/adpcm.xg: -------------------------------------------------------------------------------- 1 | TitleText: Mnemonic Count Histogram adpcm.asm 2 | 1 39.34 3 | 2 11.07 4 | 3 1.41 5 | 4 8.48 6 | 5 0.00 7 | 6 39.69 -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/ccsim: -------------------------------------------------------------------------------- 1 | g56k -D__SIMULATION__ -D__MNECOUNT__ -alo -mx-memory \ 2 | $1.c -o $1.sim.cld 3 | 4 | date > $1.sim 5 | cldinfo $1.sim.cld >> $1.sim 6 | run56sim -t -x $1.sim.cld >> $1.sim 7 | date >> $1.sim 8 | 9 | 10 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/compile: -------------------------------------------------------------------------------- 1 | g56k -S -alo -mx-memory $1.c 2 | asm56 -L -Occ $1.asm 3 | mnecount $1 4 | movecount $1 5 | tfrcount $1 6 | xgparser $1.inf -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/compile.all: -------------------------------------------------------------------------------- 1 | compile opt_adpcm-v1 2 | compile opt_adpcm-v2 3 | compile opt_adpcm-v3 4 | compile opt_adpcm-v4 5 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/data.in: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/data.in -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/data.out: -------------------------------------------------------------------------------- 1 | 2 | 0Il|z -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/data_in.c: -------------------------------------------------------------------------------- 1 | int Data_in[] = 2 | { 3 | 0x007a, 0x0079, 0x007b, 0x0077, 4 | 0x0074, 0x0073, 0x0076, 0x0074, 5 | 0x0072, 0x0073 6 | } ; 7 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/doit: -------------------------------------------------------------------------------- 1 | move_immediate opt_adpcm-v1 2 | showmoves opt_adpcm-v1.imc 3 | move_immediate opt_adpcm-v2 4 | showmoves opt_adpcm-v2.imc 5 | move_immediate opt_adpcm-v3 6 | showmoves opt_adpcm-v3.imc 7 | move_immediate opt_adpcm-v4 8 | showmoves opt_adpcm-v4.imc 9 | move_immediate opt_adpcm_call 10 | showmoves opt_adpcm_call.imc 11 | move_immediate opt_adpcm_inl 12 | showmoves opt_adpcm_inl.imc 13 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v1-grp1.xg: -------------------------------------------------------------------------------- 1 | TitleText: Move & Transfer Distribution of opt_adpcm-v1-grp1.asm 2 | 2 61.05 3 | 4 38.95 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v1.imc.xg: -------------------------------------------------------------------------------- 1 | Titletext: Immediate vs. Non Immediate Moves 2 | 1 519 3 | 3 1197 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v1.inf: -------------------------------------------------------------------------------- 1 | Titletext: Mnemonic analysis of opt_adpcm-v1.asm 2 | Grp 1 1926 3 | Grp 2 83 4 | Grp 3 98 5 | Grp 4 217 6 | Grp 5 0 7 | Grp 6 340 8 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v1.mmc.xg: -------------------------------------------------------------------------------- 1 | Titletext: Memory vs. Non Memory Moves of opt_adpcm-v1.asm 2 | 1 757 3 | 3 959 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v1.mvc: -------------------------------------------------------------------------------- 1 | Titletext: Move analysis of opt_adpcm-v1.asm 2 | 1 1224 3 | 2 621 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v1.rmc.xg: -------------------------------------------------------------------------------- 1 | Titletext: Register Indirect vs. Register Direct Moves of opt_adpcm-v1.asm 2 | 1 829 3 | 3 887 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v1.sim: -------------------------------------------------------------------------------- 1 | Fri Nov 5 20:26:27 MET 1993 2 | filename: opt_adpcm-v1.sim.cld 3 | xsize: 303, ysize: 0, psize: 3783, start addr: 0 4 | total execution time == 169613 instruction cycles 5 | Fri Nov 5 20:28:32 MET 1993 6 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v1.tfc: -------------------------------------------------------------------------------- 1 | Titletext: Move analysis of opt_adpcm-v1.asm 2 | 1 40 3 | 2 41 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v1.xg: -------------------------------------------------------------------------------- 1 | TitleText: Mnemonic Count Histogram opt_adpcm-v1.asm 2 | 1 72.30 3 | 2 3.12 4 | 3 3.68 5 | 4 8.15 6 | 5 0.00 7 | 6 12.76 -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v2-grp1.xg: -------------------------------------------------------------------------------- 1 | TitleText: Move & Transfer Distribution of opt_adpcm-v2-grp1.asm 2 | 2 65.12 3 | 4 34.88 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v2.imc.xg: -------------------------------------------------------------------------------- 1 | Titletext: Immediate vs. Non Immediate Moves 2 | 1 470 3 | 3 1166 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v2.inf: -------------------------------------------------------------------------------- 1 | Titletext: Mnemonic analysis of opt_adpcm-v2.asm 2 | Grp 1 1680 3 | Grp 2 81 4 | Grp 3 83 5 | Grp 4 198 6 | Grp 5 0 7 | Grp 6 322 8 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v2.mmc.xg: -------------------------------------------------------------------------------- 1 | Titletext: Memory vs. Non Memory Moves of opt_adpcm-v2.asm 2 | 1 740 3 | 3 896 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v2.mvc: -------------------------------------------------------------------------------- 1 | Titletext: Move analysis of opt_adpcm-v2.asm 2 | 1 1057 3 | 2 552 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v2.rmc.xg: -------------------------------------------------------------------------------- 1 | Titletext: Register Indirect vs. Register Direct Moves of opt_adpcm-v2.asm 2 | 1 817 3 | 3 819 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v2.sim: -------------------------------------------------------------------------------- 1 | Fri Nov 5 19:22:38 MET 1993 2 | filename: opt_adpcm-v2.sim.cld 3 | xsize: 303, ysize: 0, psize: 3636, start addr: 0 4 | total execution time == 156151 instruction cycles 5 | Fri Nov 5 19:24:27 MET 1993 6 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v2.tfc: -------------------------------------------------------------------------------- 1 | Titletext: Move analysis of opt_adpcm-v2.asm 2 | 1 37 3 | 2 34 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v2.xg: -------------------------------------------------------------------------------- 1 | TitleText: Mnemonic Count Histogram opt_adpcm-v2.asm 2 | 1 71.07 3 | 2 3.43 4 | 3 3.51 5 | 4 8.38 6 | 5 0.00 7 | 6 13.62 -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v3-grp1.xg: -------------------------------------------------------------------------------- 1 | TitleText: Move & Transfer Distribution of opt_adpcm-v3-grp1.asm 2 | 2 62.37 3 | 4 37.63 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v3.imc.xg: -------------------------------------------------------------------------------- 1 | Titletext: Immediate vs. Non Immediate Moves 2 | 1 424 3 | 3 917 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v3.inf: -------------------------------------------------------------------------------- 1 | Titletext: Mnemonic analysis of opt_adpcm-v3.asm 2 | Grp 1 1374 3 | Grp 2 85 4 | Grp 3 61 5 | Grp 4 194 6 | Grp 5 0 7 | Grp 6 315 8 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v3.mmc.xg: -------------------------------------------------------------------------------- 1 | Titletext: Memory vs. Non Memory Moves of opt_adpcm-v3.asm 2 | 1 551 3 | 3 790 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v3.mvc: -------------------------------------------------------------------------------- 1 | Titletext: Move analysis of opt_adpcm-v3.asm 2 | 1 824 3 | 2 489 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v3.rmc.xg: -------------------------------------------------------------------------------- 1 | Titletext: Register Indirect vs. Register Direct Moves of opt_adpcm-v3.asm 2 | 1 603 3 | 3 738 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v3.sim: -------------------------------------------------------------------------------- 1 | Fri Nov 5 19:26:23 MET 1993 2 | filename: opt_adpcm-v3.sim.cld 3 | xsize: 303, ysize: 0, psize: 3024, start addr: 0 4 | total execution time == 104420 instruction cycles 5 | Fri Nov 5 19:28:18 MET 1993 6 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v3.tfc: -------------------------------------------------------------------------------- 1 | Titletext: Move analysis of opt_adpcm-v3.asm 2 | 1 33 3 | 2 28 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v3.xg: -------------------------------------------------------------------------------- 1 | TitleText: Mnemonic Count Histogram opt_adpcm-v3.asm 2 | 1 67.72 3 | 2 4.19 4 | 3 3.01 5 | 4 9.56 6 | 5 0.00 7 | 6 15.52 -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v4-grp1.xg: -------------------------------------------------------------------------------- 1 | TitleText: Move & Transfer Distribution of opt_adpcm-v4-grp1.asm 2 | 2 61.05 3 | 4 38.95 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v4.imc.xg: -------------------------------------------------------------------------------- 1 | Titletext: Immediate vs. Non Immediate Moves 2 | 1 465 3 | 3 837 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v4.inf: -------------------------------------------------------------------------------- 1 | Titletext: Mnemonic analysis of opt_adpcm-v4.asm 2 | Grp 1 1335 3 | Grp 2 129 4 | Grp 3 59 5 | Grp 4 198 6 | Grp 5 0 7 | Grp 6 268 8 | 1335 9 | 129 10 | 59 11 | 198 12 | 0 13 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v4.mmc.xg: -------------------------------------------------------------------------------- 1 | Titletext: Memory vs. Non Memory Moves of opt_adpcm-v4.asm 2 | 1 555 3 | 3 747 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v4.mvc: -------------------------------------------------------------------------------- 1 | Titletext: Move analysis of opt_adpcm-v4.asm 2 | 1 781 3 | 2 493 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v4.rmc.xg: -------------------------------------------------------------------------------- 1 | Titletext: Register Indirect vs. Register Direct Moves of opt_adpcm-v4.asm 2 | 1 597 3 | 3 705 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v4.sim: -------------------------------------------------------------------------------- 1 | Fri Nov 5 19:26:38 MET 1993 2 | filename: opt_adpcm-v4.sim.cld 3 | xsize: 303, ysize: 0, psize: 3004, start addr: 0 4 | total execution time == 100200 instruction cycles 5 | Fri Nov 5 19:28:20 MET 1993 6 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v4.tfc: -------------------------------------------------------------------------------- 1 | Titletext: Move analysis of opt_adpcm-v4.asm 2 | 1 34 3 | 2 27 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/opt_adpcm-v4.xg: -------------------------------------------------------------------------------- 1 | TitleText: Mnemonic Count Histogram opt_adpcm-v4.asm 2 | 1 67.12 3 | 2 6.49 4 | 3 2.97 5 | 4 9.95 6 | 5 0.00 7 | 6 13.47 -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/play: -------------------------------------------------------------------------------- 1 | s56x_play -d $S56DSP/libdrp/ssirp.lod -r 8000 $HOME/cossap/costmp/data.out $1 2 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/record: -------------------------------------------------------------------------------- 1 | s56x_record -d $S56DSP/libdrp/ssirp.lod -r 8000 $HOME/cossap/costmp/data.in $1 2 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/sample.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/sample.out -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/mnemonic_count/show: -------------------------------------------------------------------------------- 1 | showgraph opt_adpcm-v$1 2 | xgraph -nl -bar -brb 1 -brw 1 -x "2 vs 4 instruct cycles operations" -y "Percent of Total Move&Transfer Operations" opt_adpcm-v$1-grp1.xg & -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/README: -------------------------------------------------------------------------------- 1 | README.FIX VERSION (MNEMONIC COUNT VERSION 1.4) 2 | ================== 3 | 4 | batch files: 5 | show shows histograms (detailed mnemonic count), as xgraph files 6 | 7 | (1) opt_adpcm.xg 8 | (2) opt_adpcm-grp1.xg 9 | 10 | showoriginal show original (straight-forward count) histograms, as xgraph files 11 | (1) opt_adpcm-orig.xg 12 | (2) opt_adpcm-grp1-orig.xg 13 | 14 | 15 | 16 | programs & listings : 17 | 18 | opt_adpcm.asm assembler file of opt_adpcm.c 19 | opt_adpcm.lst assembler listing of opt_adpcm.c 20 | 21 | opt_adpcm.xg percentual mnemonic distribution 22 | (loops, calls, etc included) - xgraph file 23 | opt_adpcm-grp1.xg percentual mnemonic distribution of move and transfer 24 | instructions (2 cycle instructions vs 4 cycles instructions) 25 | 26 | opt_adpcm.inf absolute mnemonic distribution 27 | opt_adpcm-grp1.inf absoulte mnemonic distribution of move ans transfer 28 | instructions (2 cycle instructions vs 4 cycle instructions) 29 | 30 | allgemein: 31 | 32 | 33 | *.ps postscript files containing the xgraph histograms 34 | *.xg percentual mnemonic distribution (xgraph file) 35 | *.inf absolute mnemonic distribution 36 | *.mvc move distribution 37 | move (2 instruct cycles) vs move (4 instruct cycles) 38 | *.tfc transfer distribution 39 | transfer (2 instruct cycles) vs transfer (4 instruct cycles) 40 | *.c C files (complete program or single modules) 41 | *.asm correspondent asm files 42 | *.lst correspondent lst file 43 | *.loop? program loops (1 to 7) 44 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/adpt_predict.inf: -------------------------------------------------------------------------------- 1 | Titletext: Mnemonic analysis of adpt_predict.asm 2 | Grp 1 559 3 | Grp 2 28 4 | Grp 3 23 5 | Grp 4 64 6 | Grp 5 0 7 | Grp 6 91 8 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/adpt_predict.mvc: -------------------------------------------------------------------------------- 1 | Titletext: Move analysis of adpt_predict.asm 2 | 1 8 3 | 1 7 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/adpt_predict.tfc: -------------------------------------------------------------------------------- 1 | Titletext: Move analysis of adpt_predict.asm 2 | 1 8 3 | 2 7 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/fmult.c: -------------------------------------------------------------------------------- 1 | 2 | #define LSHIFT(a, b) ((b) < 0 ? (a) << -(b) : (a) >> (b)) 3 | #define SIGNBIT(a, b) ((a) & (1 << (b)) ? 1 : 0) 4 | 5 | int f_mult(int An, int SRn) 6 | { 7 | register int EXP; 8 | register int WAnMANT; 9 | int AnS, MAG, AnMANT; 10 | 11 | AnS = SIGNBIT(An, 15); 12 | MAG = AnS? (16384 - (An >> 2)) & 8191 : An >> 2; 13 | /* { 14 | register int mag = MAG << 1; 15 | 16 | for (EXP = 0; mag >>= 1; EXP++) 17 | ; 18 | } */ 19 | 20 | AnMANT = MAG ? LSHIFT(MAG, EXP - 6) : 1 << 5; 21 | EXP += ((SRn >> 6) & 15); 22 | WAnMANT = (((SRn & 63) * AnMANT) + 48) >> 4; 23 | MAG = LSHIFT(WAnMANT, 19 - EXP) & 32767; 24 | return ((SRn >> 10) ^ AnS ? (65536 - MAG) & 65535 : MAG); 25 | } 26 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/fmult.inf: -------------------------------------------------------------------------------- 1 | Titletext: Mnemonic analysis of fmult.asm 2 | Grp 1 96 3 | Grp 2 7 4 | Grp 3 7 5 | Grp 4 16 6 | Grp 5 0 7 | Grp 6 34 8 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/fmult.mvc: -------------------------------------------------------------------------------- 1 | Titletext: Move analysis of fmult.asm 2 | 1 4 3 | 1 2 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/fmult.tfc: -------------------------------------------------------------------------------- 1 | Titletext: Move analysis of fmult.asm 2 | 1 4 3 | 2 2 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/iadpt_quant.c: -------------------------------------------------------------------------------- 1 | /* Global signals */ 2 | int A_2, AL, D, I, SD, S_E, SL, SP, TDP; 3 | 4 | 5 | typedef struct 6 | { 7 | int DQ, T, Y, YL, DQ2, DQ3, DQ4, DQ5, DQ6, DQ7, PK1, PK2, SR2, 8 | A1, A2, B[6], SE, SEZ, t_dr, LAST_TR, DMS, DML, AP, Y_L, LAST_Y; 9 | } STATES; 10 | 11 | 12 | void iadpt_quant(STATES* S) 13 | { 14 | /* 15 | * inverse adaptive quantizer 16 | * 17 | * Input signals: I, Y 18 | * Output signals: DQ 19 | */ 20 | 21 | static int qtab[] = 22 | { 23 | 2048, 4, 135, 213, 273, 323, 373, 425, 24 | 425, 373, 323, 273, 213, 135, 4, 2048, 25 | } ; 26 | register int DQL; 27 | 28 | /* RECONST and ADDA */ 29 | DQL = (qtab[I] + (S->Y >> 2)) & 4095; 30 | 31 | /* ANTILOG */ 32 | S->DQ = ((I & (1 << 3)) * (1 << 11)) + 33 | (DQL & (1 << 11) ? 0 : 34 | (((1 << 7) + (DQL & 127)) << 7) >> 35 | (14 - ((DQL >> 7) & 15))); 36 | } 37 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/iadpt_quant.inf: -------------------------------------------------------------------------------- 1 | Titletext: Mnemonic analysis of iadpt_quant.asm 2 | Grp 1 59 3 | Grp 2 5 4 | Grp 3 3 5 | Grp 4 2 6 | Grp 5 0 7 | Grp 6 14 8 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/iadpt_quant.mvc: -------------------------------------------------------------------------------- 1 | Titletext: Move analysis of iadpt_quant.asm 2 | 1 1 3 | 1 0 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/iadpt_quant.tfc: -------------------------------------------------------------------------------- 1 | Titletext: Move analysis of iadpt_quant.asm 2 | 1 1 3 | 2 0 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/opt_adpcm-grp1-orig.inf: -------------------------------------------------------------------------------- 1 | TitleText: Move & Transfer analysis of opt_adpcm.asm (straight forward) 2 | 2 878 3 | 4 524 4 | 5 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/opt_adpcm-grp1-orig.xg: -------------------------------------------------------------------------------- 1 | TitleText: Move & Transfer analysis of opt_adpcm.asm (straight forward) 2 | 2 62.62 3 | 4 37.38 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/opt_adpcm-grp1.inf: -------------------------------------------------------------------------------- 1 | Titletext: Move & Transfer analysis of opt_adpcm.asm 2 | 2 3358 3 | 4 1635 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/opt_adpcm-grp1.xg: -------------------------------------------------------------------------------- 1 | TitleText: Move & Transfer analysis of opt_adpcm.asm 2 | 2 67.25 3 | 4 32.75 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/opt_adpcm-orig.inf: -------------------------------------------------------------------------------- 1 | Titletext: Mnemonic analysis of opt_adpcm.asm (straight forward) 2 | Grp1 1402 3 | Grp2 86 4 | Grp3 61 5 | Grp4 195 6 | Grp5 0 7 | Grp6 317 8 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/opt_adpcm-orig.xg: -------------------------------------------------------------------------------- 1 | TitleText: Mnemonic Count Histogram opt_adpcm.asm (straight forward) 2 | 1 68.03 3 | 2 4.17 4 | 3 2.96 5 | 4 9.46 6 | 5 0.00 7 | 6 15.38 8 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/opt_adpcm.inf: -------------------------------------------------------------------------------- 1 | Titletext: Mnemonic analysis of opt_adpcm.asm 2 | Grp1 5176 3 | Grp2 251 4 | Grp3 214 5 | Grp4 879 6 | Grp5 0 7 | Grp6 2231 8 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/opt_adpcm.mvc: -------------------------------------------------------------------------------- 1 | Titletext: Move analysis of opt_adpcm.asm 2 | 1 845 3 | 2 495 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/opt_adpcm.tfc: -------------------------------------------------------------------------------- 1 | Titletext: Move analysis of opt_adpcm.asm 2 | 1 33 3 | 2 29 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/opt_adpcm.xg: -------------------------------------------------------------------------------- 1 | TitleText: Mnemonic Count Histogram opt_adpcm.asm 2 | 1 59.15 3 | 2 2.87 4 | 3 2.45 5 | 4 10.04 6 | 5 0.00 7 | 6 25.49 -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/opt_adpcm_total.inf: -------------------------------------------------------------------------------- 1 | Titletext: Mnemonic analysis of opt_adpcm.asm 2 | Grp1 5176 3 | Grp2 251 4 | Grp3 214 5 | Grp4 879 6 | Grp5 0 7 | Grp6 2231 8 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/opt_adpcm_total.xg: -------------------------------------------------------------------------------- 1 | TitleText: Mnemonic Count Histogram opt_adpcm.asm 2 | 1 59.15 3 | 2 2.87 4 | 3 2.45 5 | 4 10.04 6 | 5 0.00 7 | 6 25.49 -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/scale_factor.c: -------------------------------------------------------------------------------- 1 | /* Global signals */ 2 | int A_2, AL, D, I, SD, S_E, SL, SP, TDP; 3 | 4 | 5 | typedef struct 6 | { 7 | int DQ, T, Y, YL, DQ2, DQ3, DQ4, DQ5, DQ6, DQ7, PK1, PK2, SR2, 8 | A1, A2, B[6], SE, SEZ, t_dr, LAST_TR, DMS, DML, AP, Y_L, LAST_Y; 9 | } STATES; 10 | 11 | 12 | void scale_factor(STATES* S) 13 | { 14 | /* 15 | * scale factor adaptation 16 | * 17 | * Input signals: AL, I 18 | * Output signals: YL, Y 19 | */ 20 | 21 | static int W[] = 22 | { 23 | 4084, 18, 41, 64, 112, 198, 255, 1122 24 | } ; 25 | register int TMP, YUP, YLP; 26 | 27 | /* FUNCTW */ 28 | TMP = W[(I >> 3) ? (15 - I) & 7 : I & 7]; 29 | 30 | /* FILTD */ 31 | TMP = ((TMP << 5) + 131072 - S->LAST_Y) & 131071; 32 | TMP >>= 5; 33 | YUP = (TMP >> 11) ? TMP + 4096 : TMP; 34 | YUP = (YUP + S->LAST_Y) & 8191; 35 | 36 | /* LIMB */ 37 | if ((((YUP + 11264) & 16383) >> 13) == 0) 38 | YUP = 5120; 39 | if ((((YUP + 15840) & 16383) >> 13)) 40 | YUP = 544; 41 | 42 | /* FILTE */ 43 | TMP = (YUP + ((1048576 - S->Y_L) >> 6)) & 16383; 44 | if (TMP & (1 << 13)) 45 | TMP = TMP + 507904; 46 | YLP = (TMP + S->Y_L) & 524287; 47 | 48 | /* MIX */ 49 | TMP = (YUP + 16384 - (S->Y_L >> 6)) & 16383; 50 | S->LAST_Y = TMP & (1 << 13) ? 1 : 0; 51 | if (S->LAST_Y) 52 | TMP = (16384 - TMP) & 8191; 53 | TMP = (TMP * AL) >> 6; 54 | if (S->LAST_Y) 55 | TMP = (16384 - TMP) & 16383; 56 | 57 | S->LAST_Y = S->Y = ((S->Y_L >> 6) + TMP) & 8191; 58 | S->YL = S->Y_L; 59 | S->Y_L = YLP; 60 | } -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/scale_factor.inf: -------------------------------------------------------------------------------- 1 | Titletext: Mnemonic analysis of scale_factor.asm 2 | Grp 1 141 3 | Grp 2 13 4 | Grp 3 10 5 | Grp 4 11 6 | Grp 5 0 7 | Grp 6 38 8 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/scale_factor.mvc: -------------------------------------------------------------------------------- 1 | Titletext: Move analysis of scale_factor.asm 2 | 1 84 3 | 2 48 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/scale_factor.tfc: -------------------------------------------------------------------------------- 1 | Titletext: Move analysis of scale_factor.asm 2 | 1 3 3 | 2 6 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/show: -------------------------------------------------------------------------------- 1 | showgraph opt_adpcm 2 | xgraph -nl -bar -brb 1 -brw 1 -x "2 vs 4 instruct cycles operations" -y "Percent of Total Move&Transfer Operations" opt_adpcm-grp1.xg & -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/showgraph: -------------------------------------------------------------------------------- 1 | xgraph -nl -bar -brb 1 -brw 1 -x "Assembler Instructions Groups" -y "Percent of Total Instructions" $1.xg & -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/showoriginal: -------------------------------------------------------------------------------- 1 | showgraph opt_adpcm-orig 2 | xgraph -nl -bar -brb 1 -brw 1 -x "2 vs 4 instruct cycles operations" -y "Percent of Total Move&Transfer Operations (straight forward)" opt_adpcm-grp1-orig.xg & -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/speed_control.inf: -------------------------------------------------------------------------------- 1 | Titletext: Mnemonic analysis of speed_control.asm 2 | Grp 1 143 3 | Grp 2 12 4 | Grp 3 9 5 | Grp 4 14 6 | Grp 5 0 7 | Grp 6 40 8 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/speed_control.mvc: -------------------------------------------------------------------------------- 1 | Titletext: Move analysis of speed_control.asm 2 | 1 88 3 | 2 43 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/speed_control.tfc: -------------------------------------------------------------------------------- 1 | Titletext: Move analysis of speed_control.asm 2 | 1 8 3 | 2 4 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/tone_detector.c: -------------------------------------------------------------------------------- 1 | /* Global signals */ 2 | int A_2, AL, D, I, SD, S_E, SL, SP, TDP; 3 | 4 | 5 | typedef struct 6 | { 7 | int DQ, T, Y, YL, DQ2, DQ3, DQ4, DQ5, DQ6, DQ7, PK1, PK2, SR2, 8 | A1, A2, B[6], SE, SEZ, t_dr, LAST_TR, DMS, DML, AP, Y_L, LAST_Y; 9 | } STATES; 10 | 11 | void tone_detector(STATES* S) 12 | { 13 | /* 14 | * tone detector 15 | * 16 | * Input signals: DQ, A_2, YL 17 | * Output signals: T, TDP; 18 | */ 19 | 20 | register int tmp; 21 | register int t_d; 22 | 23 | /* partial band signal detection */ 24 | TDP = ((A_2 > 32769) && (A_2 < 53761)) ? 1 : 0 ; 25 | 26 | /* take last (t_dr) */ 27 | t_d = (S->t_dr); 28 | 29 | /* calcutale new (S->t_dr) */ 30 | /* TRIGB Function */ 31 | S->t_dr = S->LAST_TR ? 0 : TDP; 32 | 33 | S->LAST_TR = S->YL >> 15; /* (*LAST_TR) is used here as a temporary variable */ 34 | 35 | tmp = ((S->LAST_TR) > 8) ? 31 << 9 : 36 | (32 + ((S->LAST_TR << 5) & 31)) << S->LAST_TR; 37 | 38 | S->LAST_TR = S->T = (((S->DQ & 16383) > (tmp + (tmp >> 1)) >> 1) 39 | && (t_d == 1)) ? 1 : 0; 40 | } 41 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/tone_detector.inf: -------------------------------------------------------------------------------- 1 | Titletext: Mnemonic analysis of tone_detector.asm 2 | Grp 1 68 3 | Grp 2 2 4 | Grp 3 3 5 | Grp 4 10 6 | Grp 5 0 7 | Grp 6 17 8 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/tone_detector.mvc: -------------------------------------------------------------------------------- 1 | Titletext: Move analysis of tone_detector.asm 2 | 1 1 3 | 1 0 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_fix_adpcm/total_count/tone_detector.tfc: -------------------------------------------------------------------------------- 1 | Titletext: Move analysis of tone_detector.asm 2 | 1 1 3 | 2 0 4 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_flt_adpcm/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for the adpcm project float version 2 | CC = CC -I/usr/local/include -g 3 | 4 | flt_adpcm.exe: flt_adpcm.c 5 | $(CC) -o flt_adpcm.exe flt_adpcm.c 6 | 7 | flt_adpcm: flt_adpcm.c 8 | #create asm files 9 | g56k -alo -S -D__DSP56K__ -D__SIMULATION__ -o flt_adpcm.asm flt_adpcm.c 10 | g56k -alo -S -D__DSP56K__ -o flt_adpcm_1.asm flt_adpcm.c 11 | #create cld files and simulate 12 | g56k -alo -D__DSP56K__ -D__SIMULATION__ -o flt_adpcm.cld flt_adpcm.c 13 | g56k -alo -D__DSP56K__ -o flt_adpcm_1.cld flt_adpcm.c 14 | run56sim -t flt_adpcm.cld 15 | run56sim -t flt_adpcm_1.cld 16 | 17 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_flt_adpcm/README: -------------------------------------------------------------------------------- 1 | README FLT_ADPCM martinez 2 | ================ 3 | 4 | In diesem Verzeichnis steht das handgeschriebene floating point optimierte 5 | C Programm f"ur die adpcm Anwendung. Mit Hilfe des Makefiles und verschiedener 6 | Macros kann man folgende executables bzw. object files generieren. 7 | 8 | (1) make flt_adpcm.exe 9 | generiert ein f"ur die SUN executable Programm, die mit "runme" 10 | gestartet wird. Danach werden Eingangs- und Ausgangsdaten sowie 11 | der Fehler (Eingang - Ausgang) mit xgraph dargestellt. 12 | 13 | (2) make flt_adpcm 14 | generiert code f"ur den g56 compiler. Es werden zwei Programme compiliert 15 | a) flt_adpcm.asm, flt_adpcm.cld bei denen werden reelle Daten (CCITT) 16 | gelesen und bearbeitet. Die Anzahl der Daten h"angt von der 17 | Auskommentierung im File "data_in.c", die ggfs. included wird. 18 | b) flt_adpcm_1.asm, flt_adpcm_1.cld, bei diesen werden konstante Daten 19 | benutzt (Wert 0x7a). Die Anzahl der Daten kann man mit dem Macro 20 | N_OF_DATA im flt_adpcm.c steuern. 21 | 22 | 23 | --------------------------------------------------------------------- 24 | 25 | Mit dem shell script compile kann man das handgeschriebene floating 26 | point programm 27 | 28 | (1) Zu einem asm file compilieren 29 | (2) Zu einem cld file compilieren 30 | (3) Mnemonic Counten, Gr"o\3e bestimmen, Instruction Cycles mit 31 | dem Simulator Programm bestimmen 32 | (4) Mnemonic Information kann graphisch mit Hilfe von 33 | showgraph progname (ohne suffix) dargestellt werden 34 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_flt_adpcm/compile: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | DSPLOC=/tools/home1/dsp/dsp56k 4 | export DSPLOC 5 | 6 | ${DSPLOC}/dsp/bin/g56k -D__DSP56K__ -D__SIMULATION__ -mx-memory -alo -S ${1}.c 7 | echo assembler file ${1}.asm generated 8 | ${DSPLOC}/dsp/bin/g56k -alo -D__DSP56K__ -D__SIMULATION__ -mx-memory -o ${1}.cld ${1}.c 9 | echo cld file ${1}.cld generated 10 | echo first remove old ${1}.inf file 11 | /bin/rm ${1}.inf 12 | run56sim -t ${1}.cld > ${1}.inf 13 | echo simulation completed 14 | ${DSPLOC}/dsp/bin/cldinfo ${1}.cld >> ${1}.inf 15 | /tools/home1/martinez/bin/mnecount ${1} >> ${1}.inf 16 | echo Mnemonic Count Completed 17 | echo All information in ${1}.inf available 18 | /tools/home1/martinez/bin/xgparser ${1} 19 | showgraph ${1} 20 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_flt_adpcm/data.in: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/testsuite/benchmark/DSPStone/adpcm/is2_flt_adpcm/data.in -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_flt_adpcm/data.in.2freq: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/testsuite/benchmark/DSPStone/adpcm/is2_flt_adpcm/data.in.2freq -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_flt_adpcm/data.in.sinus: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/testsuite/benchmark/DSPStone/adpcm/is2_flt_adpcm/data.in.sinus -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_flt_adpcm/data.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/testsuite/benchmark/DSPStone/adpcm/is2_flt_adpcm/data.out -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_flt_adpcm/flt_adpcm.cld: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/testsuite/benchmark/DSPStone/adpcm/is2_flt_adpcm/flt_adpcm.cld -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_flt_adpcm/flt_adpcm.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/testsuite/benchmark/DSPStone/adpcm/is2_flt_adpcm/flt_adpcm.exe -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_flt_adpcm/flt_adpcm.inf: -------------------------------------------------------------------------------- 1 | total execution time == 34306 instruction cycles 2 | filename: flt_adpcm.cld 3 | xsize: 408, ysize: 0, psize: 5413, start addr: 0 4 | Titletext: Mnemonic analysis of flt_adpcm.asm 5 | Grp 1 1453 6 | Grp 2 1 7 | Grp 3 4 8 | Grp 4 169 9 | Grp 5 0 10 | Grp 6 101 11 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_flt_adpcm/flt_adpcm.xg: -------------------------------------------------------------------------------- 1 | TitleText: Mnemonic Count Histogram flt_adpcm.asm 2 | 1 84.09 3 | 2 0.06 4 | 3 0.23 5 | 4 9.78 6 | 5 0.00 7 | 6 5.84 -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_flt_adpcm/runme: -------------------------------------------------------------------------------- 1 | flt_adpcm.exe 2 | xgraph datain.tmp & 3 | xgraph dataout.tmp & 4 | xgraph error.tmp & -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/is2_flt_adpcm/showgraph: -------------------------------------------------------------------------------- 1 | xgraph -nl -bar -brb 1 -brw 1 -x "Assembler Instructions Groups" -y "Percent of Total Instructions" $1.xg & 2 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/itu_sun/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for CCITT subroutines and sample programs 2 | # 3 | 4 | # Modify the CC definition to invoke your ANSI-C compiler 5 | # 6 | CC = gcc -ansi 7 | 8 | 9 | # Rules to build sample programs do not depend on a UNIX library program 10 | # 11 | ALL = encode decode 12 | all: $(ALL) 13 | 14 | OBJECTS = g711.o g72x.o g721.o g723_24.o g723_40.o 15 | 16 | encode: $(OBJECTS) 17 | $(CC) -o $@ encode.c $(OBJECTS) 18 | 19 | decode: $(OBJECTS) 20 | $(CC) -o $@ decode.c $(OBJECTS) 21 | 22 | 23 | # Library rules for UNIX systems 24 | # 25 | LIB = ccitt.a 26 | lib: $(LIB) 27 | 28 | $(LIB): $(OBJECTS) 29 | @rm -f $(LIB) 30 | ar cr $(LIB) $(OBJECTS) 31 | @ranlib $(LIB) 32 | 33 | clean: 34 | /bin/rm -f $(LIB) $(ALL) *.o 35 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/itu_sun/Makefile.orig: -------------------------------------------------------------------------------- 1 | # Makefile for CCITT subroutines and sample programs 2 | # 3 | 4 | # Modify the CC definition to invoke your ANSI-C compiler 5 | # 6 | CC = acc 7 | 8 | 9 | # Rules to build sample programs do not depend on a UNIX library program 10 | # 11 | ALL = encode decode 12 | all: $(ALL) 13 | 14 | OBJECTS = g711.o g72x.o g721.o g723_24.o g723_40.o 15 | 16 | encode: $(OBJECTS) 17 | $(CC) -o $@ encode.c $(OBJECTS) 18 | 19 | decode: $(OBJECTS) 20 | $(CC) -o $@ decode.c $(OBJECTS) 21 | 22 | 23 | # Library rules for UNIX systems 24 | # 25 | LIB = ccitt.a 26 | lib: $(LIB) 27 | 28 | $(LIB): $(OBJECTS) 29 | @rm -f $(LIB) 30 | ar cr $(LIB) $(OBJECTS) 31 | @ranlib $(LIB) 32 | 33 | clean: 34 | /bin/rm -f $(LIB) $(ALL) *.o 35 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/itu_sun/ccitt.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/testsuite/benchmark/DSPStone/adpcm/itu_sun/ccitt.a -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/itu_sun/decode: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/testsuite/benchmark/DSPStone/adpcm/itu_sun/decode -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/itu_sun/encode: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/testsuite/benchmark/DSPStone/adpcm/itu_sun/encode -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/portab.h: -------------------------------------------------------------------------------- 1 | #ifndef __PORTAB_H__ 2 | #define __PORTAB_H__ 3 | 4 | #define IF_ELSE(a,b,c) ((a) ? (b) : (c)) 5 | 6 | #if defined(__DSP5600x__) 7 | 8 | #define S16BIT int 9 | #define U16BIT unsigned int 10 | #define S24BIT int 11 | #define U24BIT unsigned int 12 | #define S32BIT long 13 | #define U32BIT unsigned long 14 | 15 | #elif defined(__ADSP2101__) || defined(__TMS320C50__) || \ 16 | defined(__DSP16xx__) || defined(__DSP56156__) || \ 17 | defined(__uPD77016__) 18 | 19 | #define S16BIT int 20 | #define U16BIT unsigned int 21 | #define S24BIT long 22 | #define U24BIT unsigned long 23 | #define S32BIT long 24 | #define U32BIT unsigned long 25 | 26 | #else 27 | 28 | #define S16BIT short 29 | #define U16BIT unsigned short 30 | #define S24BIT int 31 | #define U24BIT unsigned int 32 | #define S32BIT int 33 | #define U32BIT unsigned int 34 | /* 35 | #include "mocad.H" // use this with ObjectCenter only! 36 | */ 37 | #endif 38 | #endif 39 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/portab.h.tex: -------------------------------------------------------------------------------- 1 | portab.h : 2 | \begin{verbatim} 3 | #ifndef __PORTAB_H__ 4 | #define __PORTAB_H__ 5 | 6 | #define IF_ELSE(a,b,c) ((a) ? (b) : (c)) 7 | 8 | #if defined(__DSP5600x__) 9 | 10 | #define S16BIT int 11 | #define U16BIT unsigned int 12 | #define S24BIT int 13 | #define U24BIT unsigned int 14 | #define S32BIT long 15 | #define U32BIT unsigned long 16 | 17 | #elif defined(__ADSP2101__) || defined(__TMS320C50__) || \ 18 | defined(__DSP16xx__) || defined(__DSP56156__) || \ 19 | defined(__uPD77016__) 20 | 21 | #define S16BIT int 22 | #define U16BIT unsigned int 23 | #define S24BIT long 24 | #define U24BIT unsigned long 25 | #define S32BIT long 26 | #define U32BIT unsigned long 27 | 28 | #else 29 | 30 | #define S16BIT short 31 | #define U16BIT unsigned short 32 | #define S24BIT int 33 | #define U24BIT unsigned int 34 | #define S32BIT int 35 | #define U32BIT unsigned int 36 | /* 37 | #include "mocad.H" // use this with ObjectCenter only! 38 | */ 39 | #endif 40 | #endif 41 | \end{verbatim} 42 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/test-seq/testseq: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/testsuite/benchmark/DSPStone/adpcm/test-seq/testseq -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/test-seq/testseq.unix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/testsuite/benchmark/DSPStone/adpcm/test-seq/testseq.unix -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/adpcm/verify.c: -------------------------------------------------------------------------------- 1 | #include "g721.h" 2 | 3 | U16BIT Input[] = 4 | { 5 | 0xff, 0xa7, 0x19, 0x92, 0x0f, 0x91, 0x18, 0xa3, 6 | 0x4d, 0x2b, 0x9a, 0x13, 0x8f, 0x11, 0x96, 0x20, 7 | 0xbe, 0xaf, 0x1c, 0x94, 0x10, 0x90, 0x15, 0x9e, 8 | 0x36, 0x36, 0x9e, 0x15, 0x90, 0x10, 0x94, 0x1c 9 | } ; 10 | 11 | U16BIT Output[] = 12 | { 13 | 0xff, 0xf4, 0x70, 0xec, 0x68, 0xe0, 0x59, 0xcd, 14 | 0x4d, 0x4c, 0xaf, 0x14, 0x90, 0x12, 0x98, 0x1e, 15 | 0xbe, 0xb3, 0x1e, 0x92, 0x0f, 0x90, 0x15, 0xa1, 16 | 0x30, 0x3c, 0x9f, 0x15, 0x90, 0x11, 0x96, 0x1d 17 | } ; 18 | 19 | #include "g721.c" 20 | 21 | int main(void) 22 | { 23 | int i; 24 | U16BIT I; 25 | 26 | reset_encoder(); 27 | reset_decoder(); 28 | 29 | for (i = 0; i < sizeof(Input) / sizeof(U16BIT); i++) 30 | { 31 | I = encoder(Input[i]); 32 | if (decoder(I) != Output[i]) 33 | return (-1); 34 | } 35 | return (0); 36 | } 37 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/complex_multiply/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_sources *.cpp) 2 | foreach(test_source ${test_sources}) 3 | get_filename_component(file_name ${test_source} NAME_WE) 4 | add_test_cases(${file_name}) 5 | endforeach() 6 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/complex_update/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_sources *.cpp) 2 | foreach(test_source ${test_sources}) 3 | get_filename_component(file_name ${test_source} NAME_WE) 4 | add_test_cases(${file_name}) 5 | endforeach() 6 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/convolution/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_sources *.cpp) 2 | foreach(test_source ${test_sources}) 3 | get_filename_component(file_name ${test_source} NAME_WE) 4 | add_test_cases(${file_name}) 5 | endforeach() 6 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/dot_product/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_sources *.cpp) 2 | foreach(test_source ${test_sources}) 3 | get_filename_component(file_name ${test_source} NAME_WE) 4 | add_test_cases(${file_name}) 5 | endforeach() 6 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/fft/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_sources *.cpp) 2 | foreach(test_source ${test_sources}) 3 | get_filename_component(file_name ${test_source} NAME_WE) 4 | add_test_cases(${file_name}) 5 | endforeach() 6 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/fft/include/convert.c: -------------------------------------------------------------------------------- 1 | /* convert.c */ 2 | 3 | #include 4 | 5 | int convert(float value) 6 | // float value ; 7 | { 8 | double man, t_val, frac, m, exponent = NUMBER_OF_BITS; 9 | int rnd_val; 10 | unsigned long int_val; 11 | unsigned long pm_val; 12 | 13 | #ifdef __DSP56156__ 14 | m = pow(2,exponent+1) - 1 ; 15 | #elif __DSP56000__ 16 | m = pow(2,exponent+1) - 1 ; 17 | #elif __TMS320C50__ 18 | m = pow(2,exponent+1) - 1 ; 19 | #elif __ADSP2101__ 20 | m = pow(2,exponent+1) - 1 ; 21 | #else 22 | m = exp(exponent+1) - 1 ; 23 | #endif 24 | 25 | t_val = value * m ; 26 | frac = modf(t_val,&man); 27 | if (frac < 0) 28 | { 29 | rnd_val = (-1); 30 | if (frac > -0.5) rnd_val = 0; 31 | } 32 | else 33 | { 34 | rnd_val = 1; 35 | if (frac < 0.5) rnd_val = 0; 36 | } 37 | 38 | int_val = man + rnd_val; 39 | 40 | pm_val = int_val ; 41 | return ((int) (pm_val)) ; 42 | 43 | } 44 | 45 | void float2fract() 46 | { 47 | float f ; 48 | int j, i ; 49 | 50 | for (j = 0 ; j < N_FFT ; j++) 51 | { 52 | f = input[j] ; 53 | i = convert(f) ; 54 | inputfract[j] = i ; 55 | } 56 | } 57 | 58 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/fft/include/debug.c: -------------------------------------------------------------------------------- 1 | /* 2 | * convert float to fract (format 1.NUMBER_OF_BITS) 3 | * 4 | * author : Juan Martinez Velarde 5 | * 6 | * 07-02-94 7 | * 8 | */ 9 | 10 | FILE *FFT_FILE ; 11 | 12 | void pin_down_debug() 13 | { 14 | 15 | /* open dump file */ 16 | 17 | char fname[20]; 18 | char *pfname = fname; 19 | 20 | fname[0] = (char) NULL ; 21 | 22 | #ifdef __DSP56000__ 23 | strcat(pfname, "inpsca_16.dat") ; 24 | #elif __DSP56156__ 25 | strcat(pfname, "inpsca_16.dat") ; 26 | #else 27 | strcat(pfname, "unix_inpsca_16.dat") ; 28 | #endif 29 | 30 | if ((FFT_FILE = fopen(fname, "w")) == 0) 31 | { 32 | printf("%s \n", "Cannot open output file %s\n correctly", fname); 33 | exit(1); 34 | } 35 | } 36 | 37 | 38 | void 39 | dump_to_file(TYPE input_data[]) 40 | // TYPE input_data[] ; 41 | { 42 | 43 | double m, exponent = NUMBER_OF_BITS ; 44 | STORAGE_CLASS TYPE f ; 45 | STORAGE_CLASS TYPE *ps; 46 | 47 | /* write the real values to the dump file */ 48 | 49 | ps = &input_data[0]; 50 | 51 | #ifdef __DSP56000__ 52 | m = pow(exponent,2) ; 53 | #elif __DSP56156__ 54 | m = pow(exponent,2) ; 55 | #else 56 | m = exp2(exponent) ; 57 | #endif 58 | 59 | for (f = 0; f < N_FFT; f++) 60 | { 61 | fprintf(FFT_FILE, "%i %f\n",f, ((float) (*ps)) / m ) ; 62 | ps += 2 ; 63 | } 64 | 65 | fclose(FFT_FILE); 66 | 67 | } 68 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/fft/include/input_data/input16.dat: -------------------------------------------------------------------------------- 1 | float input[16] = { 0.243,0.323, 0.505 , -0.176 , -0.87, 0.353, -0.344, -0.443, -0.434, -0.32, 0.232 , -0.454, -0.32, -0.323, -0.733, 0.54} ; 2 | 3 | 4 | int inputfract[N_FFT] ; /* will hold the transformed data */ 5 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/fft/include/input_data/twids16-13.dat: -------------------------------------------------------------------------------- 1 | int twidtable[30] = {8192 2 | ,0 3 | ,8192 4 | ,0 5 | ,0 6 | ,-8192 7 | ,8192 8 | ,0 9 | ,5792 10 | ,-5792 11 | ,0 12 | ,-8191 13 | ,-5792 14 | ,-5792 15 | ,8192 16 | ,0 17 | ,7568 18 | ,-3134 19 | ,5792 20 | ,-5792 21 | ,3134 22 | ,-7568 23 | ,0 24 | ,-8192 25 | ,-3134 26 | ,-7568 27 | ,-5792 28 | ,-5792 29 | ,-7568 30 | ,-3134 } ; 31 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/fft/include/input_data/twids16-7.dat: -------------------------------------------------------------------------------- 1 | int twidtable[30]={127, 2 | 0, 3 | 127, 4 | 0, 5 | 0, 6 | -127, 7 | 127, 8 | 0, 9 | 90, 10 | -90, 11 | 0, 12 | -127, 13 | -90, 14 | -90, 15 | 127, 16 | 0, 17 | 117, 18 | -49, 19 | 90, 20 | -90, 21 | 49, 22 | -117, 23 | 0, 24 | -127, 25 | -49, 26 | -117, 27 | -90, 28 | -90, 29 | -117, 30 | -49 31 | } ; 32 | 33 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/fft/include/main1024_bit_reduct.h: -------------------------------------------------------------------------------- 1 | 2 | // #ifdef __PROF56__ 3 | // #include 4 | // #endif 5 | 6 | #define STORAGE_CLASS register 7 | #define TYPE int 8 | 9 | #define N_FFT 1024 10 | #define NUMBER_OF_BITS 13 /* fract format 1.NUMBER_OF_BITS = 1.13 */ 11 | 12 | #define BITS_PER_TWID 13 /* bits per twiddle coefficient */ 13 | #define SHIFT BITS_PER_TWID /* fractional shift after each multiplication */ 14 | 15 | #ifdef __PROF56__ 16 | volatile extern int __time; 17 | volatile int t; 18 | #include "debug.c" 19 | #endif 20 | 21 | 22 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/fft/include/main1024_inpsca.h: -------------------------------------------------------------------------------- 1 | 2 | // #ifdef __PROF56__ 3 | // #include 4 | // #endif 5 | 6 | #define STORAGE_CLASS register 7 | #define TYPE int 8 | 9 | #define N_FFT 1024 10 | #define NUMBER_OF_BITS 9 /* fract format 1.NUMBER_OF_BITS = 1.9 */ 11 | 12 | #define BITS_PER_TWID 7 /* bits per twiddle coefficient */ 13 | #define SHIFT BITS_PER_TWID /* fractional shift after each multiplication */ 14 | 15 | #ifdef __PROF56__ 16 | volatile extern __time; 17 | volatile int t; 18 | #include "debug.c" 19 | #endif 20 | 21 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/fft/include/main16_bit_reduct.h: -------------------------------------------------------------------------------- 1 | 2 | //#ifdef __PROF56__ 3 | //#include 4 | //#endif 5 | 6 | #define STORAGE_CLASS register 7 | #define TYPE int 8 | 9 | #define N_FFT 16 10 | #define NUMBER_OF_BITS 13 /* fract format 1.NUMBER_OF_BITS = 1.13 */ 11 | 12 | #define BITS_PER_TWID 13 /* bits per twiddle coefficient */ 13 | #define SHIFT BITS_PER_TWID /* fractional shift after each multiplication */ 14 | 15 | #ifdef __PROF56__ 16 | volatile extern __time; 17 | volatile int t; 18 | #include "debug.c" 19 | #endif 20 | 21 | 22 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/fft/include/main16_inpsca.h: -------------------------------------------------------------------------------- 1 | 2 | //#ifdef __PROF56__ 3 | //#include 4 | //#endif 5 | 6 | #define STORAGE_CLASS register 7 | #define TYPE int 8 | 9 | #define N_FFT 16 10 | #define NUMBER_OF_BITS 9 /* fract format 1.NUMBER_OF_BITS = 1.9 */ 11 | 12 | #define BITS_PER_TWID 7 /* bits per twiddle coefficient */ 13 | #define SHIFT BITS_PER_TWID /* fractional shift after each multiplication */ 14 | 15 | #ifdef __PROF56__ 16 | volatile extern __time; 17 | volatile int t; 18 | #include "debug.c" 19 | #endif 20 | 21 | 22 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/fir/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_sources *.cpp) 2 | foreach(test_source ${test_sources}) 3 | get_filename_component(file_name ${test_source} NAME_WE) 4 | add_test_cases(${file_name}) 5 | endforeach() 6 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/fir2dim/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_sources *.cpp) 2 | foreach(test_source ${test_sources}) 3 | get_filename_component(file_name ${test_source} NAME_WE) 4 | add_test_cases(${file_name}) 5 | endforeach() 6 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/iir_biquad_N_sections/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_sources *.cpp) 2 | foreach(test_source ${test_sources}) 3 | get_filename_component(file_name ${test_source} NAME_WE) 4 | add_test_cases(${file_name}) 5 | endforeach() 6 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/iir_biquad_one_section/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_sources *.cpp) 2 | foreach(test_source ${test_sources}) 3 | get_filename_component(file_name ${test_source} NAME_WE) 4 | add_test_cases(${file_name}) 5 | endforeach() 6 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/lms/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_sources *.cpp) 2 | foreach(test_source ${test_sources}) 3 | get_filename_component(file_name ${test_source} NAME_WE) 4 | add_test_cases(${file_name}) 5 | endforeach() 6 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/matrix/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_sources *.cpp) 2 | foreach(test_source ${test_sources}) 3 | get_filename_component(file_name ${test_source} NAME_WE) 4 | add_test_cases(${file_name}) 5 | endforeach() 6 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/matrix1x3/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_sources *.cpp) 2 | foreach(test_source ${test_sources}) 3 | get_filename_component(file_name ${test_source} NAME_WE) 4 | add_test_cases(${file_name}) 5 | endforeach() 6 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/n_complex_updates/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_sources *.cpp) 2 | foreach(test_source ${test_sources}) 3 | get_filename_component(file_name ${test_source} NAME_WE) 4 | add_test_cases(${file_name}) 5 | endforeach() 6 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/n_real_updates/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_sources *.cpp) 2 | foreach(test_source ${test_sources}) 3 | get_filename_component(file_name ${test_source} NAME_WE) 4 | add_test_cases(${file_name}) 5 | endforeach() 6 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/real_update/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_sources *.cpp) 2 | foreach(test_source ${test_sources}) 3 | get_filename_component(file_name ${test_source} NAME_WE) 4 | add_test_cases(${file_name}) 5 | endforeach() 6 | -------------------------------------------------------------------------------- /testsuite/benchmark/DSPStone/startup/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_sources *.cpp) 2 | foreach(test_source ${test_sources}) 3 | get_filename_component(file_name ${test_source} NAME_WE) 4 | add_test_cases(${file_name}) 5 | endforeach() 6 | -------------------------------------------------------------------------------- /testsuite/cmake/FindLLVM.cmake: -------------------------------------------------------------------------------- 1 | FIND_PATH(LLVM_BIN_DIR sync) 2 | 3 | IF(LLVM_BIN_DIR) 4 | SET(LLVM_FOUND TRUE) 5 | ENDIF(LLVM_BIN_DIR) 6 | 7 | IF (LLVM_FOUND) 8 | set(SYNC ${LLVM_BIN_DIR}/sync) 9 | set(LLC ${LLVM_BIN_DIR}/llc) 10 | set(LLI ${LLVM_BIN_DIR}/lli) 11 | set(LLVM_AS ${LLVM_BIN_DIR}/llvm-as) 12 | set(LLVM_LD ${LLVM_BIN_DIR}/llvm-ld) 13 | IF (NOT LLVM_FIND_QUIETLY) 14 | MESSAGE(STATUS "Found LLVM: ${LLVM_BIN_DIR}") 15 | ENDIF (NOT LLVM_FIND_QUIETLY) 16 | ELSE (LLVM_FOUND) 17 | IF (LLVM_FIND_REQUIRED) 18 | MESSAGE(FATAL_ERROR "Could not find SYNC") 19 | ENDIF (LLVM_FIND_REQUIRED) 20 | ENDIF (LLVM_FOUND) 21 | -------------------------------------------------------------------------------- /testsuite/cmake/FindLLVMGCC.cmake: -------------------------------------------------------------------------------- 1 | FIND_PATH(LLVMGCC_BIN_DIR llvm-gcc) 2 | 3 | IF(LLVMGCC_BIN_DIR) 4 | SET(LLVMGCC_FOUND TRUE) 5 | ENDIF(LLVMGCC_BIN_DIR) 6 | 7 | IF (LLVMGCC_FOUND) 8 | set(LLVMGCC ${LLVMGCC_BIN_DIR}/llvm-gcc) 9 | IF (NOT LLVMGCC_FIND_QUIETLY) 10 | MESSAGE(STATUS "Found LLVMGCC: ${LLVMGCC_BIN_DIR}") 11 | ENDIF (NOT LLVMGCC_FIND_QUIETLY) 12 | ELSE (LLVMGCC_FOUND) 13 | IF (LLVMGCC_FIND_REQUIRED) 14 | MESSAGE(FATAL_ERROR "Could not find LLC") 15 | ENDIF (LLVMGCC_FIND_REQUIRED) 16 | ENDIF (LLVMGCC_FOUND) 17 | -------------------------------------------------------------------------------- /testsuite/cmake/FindSystemC.cmake: -------------------------------------------------------------------------------- 1 | FIND_PATH(SYSTEMC_ROOT_DIR lib-linux64) 2 | 3 | IF (SYSTEMC_ROOT_DIR) 4 | SET(SystemC_FOUND TRUE) 5 | ENDIF (SYSTEMC_ROOT_DIR) 6 | 7 | 8 | IF (SystemC_FOUND) 9 | SET(SYSTEMC ${SYSTEMC_ROOT_DIR}) 10 | IF (NOT SystemC_FIND_QUIETLY) 11 | MESSAGE(STATUS "Found SystemC: ${SYSTEMC}") 12 | ENDIF (NOT SystemC_FIND_QUIETLY) 13 | ELSE (SystemC_FOUND) 14 | IF (SystemC_FIND_REQUIRED) 15 | MESSAGE(FATAL_ERROR "Could not find SystemC!") 16 | ENDIF (SystemC_FIND_REQUIRED) 17 | ENDIF (SystemC_FOUND) 18 | -------------------------------------------------------------------------------- /testsuite/cmake/FindVerilator.cmake: -------------------------------------------------------------------------------- 1 | FIND_PATH(VERILATOR_ROOT_DIR bin/verilator) 2 | 3 | IF (VERILATOR_ROOT_DIR) 4 | SET(Verilator_FOUND TRUE) 5 | ENDIF (VERILATOR_ROOT_DIR) 6 | 7 | 8 | IF (Verilator_FOUND) 9 | SET(VERILATOR_EXECUTABLE ${VERILATOR_ROOT_DIR}/bin/verilator) 10 | IF (NOT Verilato_FIND_QUIETLY) 11 | MESSAGE(STATUS "Found Verilator: ${VERILATOR_EXECUTABLE}") 12 | ENDIF (NOT Verilato_FIND_QUIETLY) 13 | ELSE (Verilator_FOUND) 14 | IF (Verilator_FIND_REQUIRED) 15 | MESSAGE(FATAL_ERROR "Could not find Verilator!") 16 | ENDIF (Verilator_FIND_REQUIRED) 17 | ENDIF (Verilator_FOUND) 18 | -------------------------------------------------------------------------------- /testsuite/liblegup.bc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzhhb/Shang/eb4aa11385b93af4b73cfd4701e1473124ada325/testsuite/liblegup.bc -------------------------------------------------------------------------------- /tools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(sync) 2 | -------------------------------------------------------------------------------- /tools/LLVMBuild.txt: -------------------------------------------------------------------------------- 1 | ;===- ./lib/Target/VerilogBackend/tools/LLVMBuild.txt ------------*- Conf -*--===; 2 | ; 3 | ; The LLVM Compiler Infrastructure 4 | ; 5 | ; This file is distributed under the University of Illinois Open Source 6 | ; License. See LICENSE.TXT for details. 7 | ; 8 | ;===------------------------------------------------------------------------===; 9 | ; 10 | ; This is an LLVMBuild description file for the components in this subdirectory. 11 | ; 12 | ; For more information on the LLVMBuild system, please see: 13 | ; 14 | ; http://llvm.org/docs/LLVMBuild.html 15 | ; 16 | ;===------------------------------------------------------------------------===; 17 | 18 | [common] 19 | subdirectories = sync 20 | -------------------------------------------------------------------------------- /tools/sync/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(LLVM_LINK_COMPONENTS VerilogBackend bitreader asmparser codegen SelectionDAG transformutils ipo) 2 | 3 | set(LLVM_REQUIRES_RTTI 1) 4 | set(LLVM_REQUIRES_EH 1) 5 | 6 | include_directories( 7 | ${BOOST_INCLUDE_DIR} 8 | ${LUA_INCLUDE_DIR} 9 | ${LUABIND_INCLUDE_DIR} 10 | ${LUABIND_INCLUDE_DIR}/luabind 11 | ) 12 | 13 | add_llvm_tool(sync 14 | sync.cpp 15 | ) 16 | -------------------------------------------------------------------------------- /tools/sync/LLVMBuild.txt: -------------------------------------------------------------------------------- 1 | ;===- ./lib/Target/VerilogBackend/tools/sync/LLVMBuild.txt ------------*- Conf -*--===; 2 | ; 3 | ; The LLVM Compiler Infrastructure 4 | ; 5 | ; This file is distributed under the University of Illinois Open Source 6 | ; License. See LICENSE.TXT for details. 7 | ; 8 | ;===------------------------------------------------------------------------===; 9 | ; 10 | ; This is an LLVMBuild description file for the components in this subdirectory. 11 | ; 12 | ; For more information on the LLVMBuild system, please see: 13 | ; 14 | ; http://llvm.org/docs/LLVMBuild.html 15 | ; 16 | ;===------------------------------------------------------------------------===; 17 | 18 | [component_0] 19 | type = Tool 20 | name = sync 21 | parent = Tools 22 | required_libraries = VerilogBackendCodegen AsmParser BitReader BitWriter IPO Instrumentation Scalar Support Core 23 | 24 | -------------------------------------------------------------------------------- /util/TestAllDelayandLEs/Addtest.v.in: -------------------------------------------------------------------------------- 1 | `define WIDTH @WIDTH@ 2 | `define BIT 1 3 | 4 | module @TEST_NAMES@( 5 | input clk, 6 | input wire[`WIDTH-1:0] a, 7 | input wire[`WIDTH-1:0] b, 8 | input wire[`BIT-1:0] c, 9 | output reg[`WIDTH:0] d 10 | ); 11 | 12 | reg [`WIDTH-1:0] a_reg0; 13 | reg [`WIDTH-1:0] a_reg1; 14 | reg [`WIDTH-1:0] b_reg0; 15 | reg [`WIDTH-1:0] b_reg1; 16 | reg [`BIT-1:0] c_reg0; 17 | reg [`BIT-1:0] c_reg1; 18 | reg [`WIDTH:0] d_reg0; 19 | wire [`WIDTH:0] d_wire; 20 | 21 | always@(posedge clk) begin 22 | a_reg0 <= a; 23 | a_reg1 <= a_reg0; 24 | b_reg0 <= b; 25 | b_reg1 <= b_reg0; 26 | c_reg0 <= c; 27 | c_reg1 <= c_reg0; 28 | d_reg0 <= d_wire; 29 | d <= d_reg0; 30 | end 31 | 32 | Add i0( 33 | .a(a_reg1), 34 | .b(b_reg1), 35 | .c(c_reg1), 36 | .d(d_wire) 37 | ); 38 | 39 | endmodule 40 | 41 | module Add( 42 | input wire[`WIDTH-1:0] a, 43 | input wire[`WIDTH-1:0] b, 44 | input wire[`BIT-1:0] c, 45 | output wire[`WIDTH:0] d 46 | ); 47 | 48 | assign d = a + b + c; 49 | 50 | endmodule 51 | -------------------------------------------------------------------------------- /util/TestAllDelayandLEs/Cmptest.v.in: -------------------------------------------------------------------------------- 1 | `define WIDTH @WIDTH@ 2 | `define BIT 1 3 | 4 | module @TEST_NAMES@( 5 | input clk, 6 | input wire[`WIDTH-1:0] a, 7 | input wire[`WIDTH-1:0] b, 8 | output reg[`BIT-1:0] c 9 | ); 10 | 11 | reg [`WIDTH-1:0] a_reg0; 12 | reg [`WIDTH-1:0] a_reg1; 13 | reg [`WIDTH-1:0] b_reg0; 14 | reg [`WIDTH-1:0] b_reg1; 15 | reg [`BIT-1:0] c_reg0; 16 | wire [`BIT-1:0] c_wire; 17 | always@(posedge clk) begin 18 | a_reg0 <= a; 19 | a_reg1 <= a_reg0; 20 | b_reg0 <= b; 21 | b_reg1 <= b_reg0; 22 | c_reg0 <= c_wire; 23 | c <= c_reg0; 24 | end 25 | 26 | Cmp i0( 27 | .a(a_reg1), 28 | .b(b_reg1), 29 | .c(c_wire) 30 | ); 31 | 32 | endmodule 33 | 34 | module Cmp( 35 | input wire[`WIDTH-1:0] a, 36 | input wire[`WIDTH-1:0] b, 37 | output wire[`BIT-1:0] c 38 | ); 39 | 40 | assign c = (a > b)? 1:0; 41 | 42 | endmodule 43 | -------------------------------------------------------------------------------- /util/TestAllDelayandLEs/Json2LuaScript_Others.py: -------------------------------------------------------------------------------- 1 | import json 2 | from optparse import OptionParser 3 | 4 | parser = OptionParser() 5 | parser.add_option("-t", "--timing_report", dest="timing_report", 6 | help="Timing report to read", metavar="FILE") 7 | 8 | parser.add_option("-o", "--output", dest="output", 9 | help="The output LUAScript file", metavar="FILE") 10 | 11 | (options, args) = parser.parse_args() 12 | 13 | with open(options.timing_report,"r") as f: 14 | read_data = '['+f.read()[1:]+']' 15 | f.closed 16 | json_read = json.loads(read_data) 17 | 18 | Writefile = open(options.output,'w') 19 | 20 | # The FU dictionary 21 | FUs = {} 22 | 23 | for data in json_read: 24 | CurFUs = { data["Bit_Width"] : { "LEs" : data["Total_LEs"], "Delay" : data["delay"] } } 25 | CurFUs.update(FUs.get(data["name"], {})) 26 | FUs[data["name"]] = CurFUs 27 | 28 | 29 | for name, bits in FUs.iteritems() : 30 | print "FUs.%s = {" % name 31 | print "\tLatencies = { %s / PERIOD, %s / PERIOD, %s / PERIOD, %s / PERIOD, %s / PERIOD }, --%s " % (bits['1']['Delay'],bits['8']['Delay'],bits['16']['Delay'],bits['32']['Delay'],bits['64']['Delay'], name) 32 | print "\tCosts = {%s * 64, %s * 64, %s * 64, %s * 64, %s * 64}, --%s " % (bits['1']['LEs'] , bits['8']['LEs'], bits['16']['LEs'], bits['32']['LEs'], bits['64']['LEs'], name) 33 | 34 | 35 | Writefile.close() 36 | 37 | -------------------------------------------------------------------------------- /util/TestAllDelayandLEs/Multest.v.in: -------------------------------------------------------------------------------- 1 | `define WIDTH @WIDTH@ 2 | 3 | module @TEST_NAMES@( 4 | input clk, 5 | input wire[`WIDTH-1:0] a, 6 | input wire[`WIDTH-1:0] b, 7 | output reg[2 * `WIDTH-1:0] c 8 | ); 9 | 10 | reg [`WIDTH-1:0] a_reg0; 11 | reg [`WIDTH-1:0] a_reg1; 12 | reg [`WIDTH-1:0] b_reg0; 13 | reg [`WIDTH-1:0] b_reg1; 14 | reg [2 * `WIDTH-1:0] c_reg0; 15 | wire [2 * `WIDTH-1:0] c_wire; 16 | 17 | always@(posedge clk) begin 18 | a_reg0 <= a; 19 | a_reg1 <= a_reg0; 20 | b_reg0 <= b; 21 | b_reg1 <= b_reg0; 22 | c_reg0 <= c_wire; 23 | c <= c_reg0; 24 | end 25 | 26 | Mul i0( 27 | .a(a_reg1), 28 | .b(b_reg1), 29 | .c(c_wire) 30 | ); 31 | 32 | endmodule 33 | 34 | (* multstyle = "logic" *) module Mul( 35 | input wire[`WIDTH-1:0] a, 36 | input wire[`WIDTH-1:0] b, 37 | output wire[2 * `WIDTH - 1:0] c 38 | ); 39 | 40 | assign c = a * b; 41 | 42 | endmodule 43 | -------------------------------------------------------------------------------- /util/TestAllDelayandLEs/MuxReadRpt.py.in: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | f=open('@FIT_FILE@','r+') 4 | writefile = open('@LE_REPORT_FILE_MUX@','a') 5 | Total_LEs = 0 6 | #Put the max number in testDict 7 | for line in f: 8 | m=re.match(r"^;\s*\|mux:i1\|\s*;\s(\d*)\s\(",line) 9 | if m: 10 | print m.group(1) 11 | Total_LEs = m.group(1) 12 | #print m.group(2) 13 | print m.group(0) 14 | writefile.write(",\n{\"Name\":\"@TEST_NAMES@\",\n") 15 | writefile.write("\"Input_Num\":\"@INPUT_NUM@\",\n") 16 | writefile.write("\"Width\":\"@WIDTH@\",\n") 17 | writefile.write("\"Total_LEs\":\"%s\""%(Total_LEs)) 18 | writefile.write("}\n") 19 | writefile.close() 20 | f.close() 21 | JustForCmake = open('@PseudoTarget@','w+') 22 | JustForCmake.write("JustForCmake") 23 | JustForCmake.close() 24 | 25 | -------------------------------------------------------------------------------- /util/TestAllDelayandLEs/ReadRpt.py.in: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | f=open('@FIT_FILE@','r+') 4 | writefile = open('@LE_REPORT_FILE@','a') 5 | Total_LEs = 0 6 | #Put the max number in testDict 7 | for line in f: 8 | m=re.match(r"^;\s*\|@DUT_NAME@:i0\|\s*;\s(\d*)\s\(",line) 9 | if m: 10 | print m.group(1) 11 | Total_LEs = m.group(1) 12 | print m.group(0) 13 | writefile.write(",\n{\"Name\":\"@TEST_NAMES@\",\n") 14 | writefile.write("\"Width\":\"@WIDTH@\",\n") 15 | writefile.write("\"Total_LEs\":\"%s\""%(Total_LEs)) 16 | writefile.write("}\n") 17 | writefile.close() 18 | f.close() 19 | JustForCmake = open('@PseudoTarget@','w+') 20 | JustForCmake.write("JustForCmake") 21 | JustForCmake.close() 22 | 23 | -------------------------------------------------------------------------------- /util/TestAllDelayandLEs/Redtest.v.in: -------------------------------------------------------------------------------- 1 | `define WIDTH @WIDTH@ 2 | 3 | module @TEST_NAMES@( 4 | input clk, 5 | input wire[`WIDTH-1:0] a, 6 | output reg[`WIDTH-1:0] b 7 | ); 8 | 9 | reg [`WIDTH-1:0] a_reg0; 10 | reg [`WIDTH-1:0] a_reg1; 11 | reg [`WIDTH-1:0] b_reg; 12 | wire [`WIDTH-1:0] b_wire; 13 | 14 | always@(posedge clk) begin 15 | a_reg0 <= a; 16 | a_reg1 <= a_reg0; 17 | b_reg <= b_wire; 18 | b <= b_reg; 19 | end 20 | 21 | Red i0( 22 | .a(a_reg1), 23 | .b(b_wire) 24 | ); 25 | 26 | endmodule 27 | 28 | module Red( 29 | input wire[`WIDTH-1:0] a, 30 | output wire[`WIDTH-1:0] b 31 | ); 32 | 33 | assign b = &a; 34 | 35 | endmodule 36 | -------------------------------------------------------------------------------- /util/TestAllDelayandLEs/Seltest.v.in: -------------------------------------------------------------------------------- 1 | `define WIDTH @WIDTH@ 2 | `define BIT 1 3 | 4 | module @TEST_NAMES@( 5 | input clk, 6 | input wire[`WIDTH-1:0] a, 7 | input wire[`WIDTH-1:0] b, 8 | input wire[`BIT-1:0] c, 9 | output reg[`WIDTH-1:0] d 10 | ); 11 | 12 | reg [`WIDTH-1:0] a_reg0; 13 | reg [`WIDTH-1:0] a_reg1; 14 | reg [`WIDTH-1:0] b_reg0; 15 | reg [`WIDTH-1:0] b_reg1; 16 | reg [`BIT-1:0] c_reg0; 17 | reg [`BIT-1:0] c_reg1; 18 | reg [`WIDTH-1:0] d_reg; 19 | wire [`WIDTH-1:0] d_wire; 20 | 21 | always@(posedge clk) begin 22 | a_reg0 <= a; 23 | a_reg1 <= a_reg0; 24 | b_reg0 <= b; 25 | b_reg1 <= b_reg0; 26 | c_reg0 <= c; 27 | c_reg1 <= c_reg0; 28 | d_reg <= d_wire; 29 | d <= d_reg; 30 | end 31 | 32 | Sel i0( 33 | .a(a_reg1), 34 | .b(b_reg1), 35 | .c(c_reg1), 36 | .d(d_wire) 37 | ); 38 | 39 | endmodule 40 | 41 | module Sel( 42 | input wire[`WIDTH-1:0] a, 43 | input wire[`WIDTH-1:0] b, 44 | input wire[`BIT-1:0] c, 45 | output wire[`WIDTH-1:0] d 46 | ); 47 | 48 | assign d = c ? a : b; 49 | 50 | endmodule 51 | -------------------------------------------------------------------------------- /util/TestAllDelayandLEs/Shifttest.v.in: -------------------------------------------------------------------------------- 1 | `define WIDTH @WIDTH@ 2 | 3 | module @TEST_NAMES@( 4 | input clk, 5 | input wire[`WIDTH-1:0] a, 6 | input wire[`WIDTH-1:0] b, 7 | output reg[`WIDTH-1:0] c 8 | ); 9 | 10 | reg [`WIDTH-1:0] a_reg0; 11 | reg [`WIDTH-1:0] a_reg1; 12 | reg [`WIDTH-1:0] b_reg0; 13 | reg [`WIDTH-1:0] b_reg1; 14 | reg [`WIDTH-1:0] c_reg0; 15 | wire [`WIDTH-1:0] c_wire; 16 | 17 | always@(posedge clk) begin 18 | a_reg0 <= a; 19 | a_reg1 <= a_reg0; 20 | b_reg0 <= b; 21 | b_reg1 <= b_reg0; 22 | c_reg0 <= c_wire; 23 | c <= c_reg0; 24 | end 25 | 26 | Shift i0( 27 | .a(a_reg1), 28 | .b(b_reg1), 29 | .c(c_wire) 30 | ); 31 | 32 | endmodule 33 | 34 | module Shift( 35 | input wire[`WIDTH-1:0] a, 36 | input wire[`WIDTH-1:0] b, 37 | output wire[`WIDTH-1:0] c 38 | ); 39 | 40 | assign c = a >> b; 41 | 42 | endmodule 43 | -------------------------------------------------------------------------------- /util/TestAllDelayandLEs/extract_timing.tcl.in: -------------------------------------------------------------------------------- 1 | if {"@IsMux@" == "testMux"} { 2 | set FileTmp [open "@TIMING_REPORT_JSON_MUX@" a+] 3 | foreach_in_collection path [get_timing_paths -setup -npath 1 -detail path_only] { 4 | set Data_Delay [get_path_info $path -num_logic_levels] 5 | puts $FileTmp ",\n\{\"name\":\"@DUT_NAME@\"," 6 | puts $FileTmp "\"delay\":\"$Data_Delay\"," 7 | } 8 | } else { 9 | set FileTmp [open "@TIMING_REPORT_JSON@" a+] 10 | foreach_in_collection path [get_timing_paths -setup -npath 1 -detail path_only] { 11 | set Data_Delay [get_path_info $path -num_logic_levels] 12 | puts $FileTmp ",\n\{\"name\":\"@DUT_NAME@\"," 13 | puts $FileTmp "\"delay\":\"$Data_Delay\"," 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /util/TestAllDelayandLEs/test.sdc: -------------------------------------------------------------------------------- 1 | create_clock -name "clk" -period 1ns [get_ports {clk}] 2 | derive_pll_clocks -create_base_clocks 3 | derive_clock_uncertainty 4 | 5 | --------------------------------------------------------------------------------