├── .gitignore ├── Images ├── image.pth ├── image_mnist.pth └── readme.md ├── LICENSE ├── ORION3_0 ├── ARESLab │ ├── ARESLab.pdf │ ├── Changes.txt │ ├── DESCRIPTION.txt │ ├── aresanova.m │ ├── aresanovareduce.m │ ├── aresbuild.m │ ├── arescv.m │ ├── arescvc.m │ ├── areseq.m │ ├── aresparams.m │ ├── aresplot.m │ ├── arespredict.m │ ├── arestest.m │ ├── gpl-3.0.txt │ └── private │ │ ├── createbasisfunction.m │ │ └── findsideknots.m ├── CLKCTRL.c ├── CLKCTRL.h ├── INBUF.c ├── INBUF.h ├── KG.m ├── KG.sh ├── LSQR.m ├── LSQR.sh ├── MARS.m ├── MARS.sh ├── Makefile ├── NONPR.c ├── NONPR.h ├── NeuroSIM.txt ├── OUTBUF.c ├── OUTBUF.h ├── RBF.m ├── RBF.sh ├── README ├── README.ORION1.0 ├── README.ORION2.0 ├── SIM_ALU.c ├── SIM_ALU.h ├── SIM_ALU_model.h ├── SIM_arbiter.c ├── SIM_arbiter.h ├── SIM_array.h ├── SIM_array_internal.h ├── SIM_array_l.c ├── SIM_array_m.c ├── SIM_array_model.h ├── SIM_cam.c ├── SIM_cam.h ├── SIM_clock.c ├── SIM_clock.h ├── SIM_crossbar.c ├── SIM_crossbar.h ├── SIM_link.c ├── SIM_link.h ├── SIM_link_model.h ├── SIM_misc.c ├── SIM_misc.h ├── SIM_misc_model.h ├── SIM_parameter.h ├── SIM_permu.c ├── SIM_permu.h ├── SIM_permu_model.h ├── SIM_port.h ├── SIM_port_NEC.h ├── SIM_port_TRIPS.h ├── SIM_port_alpha.h ├── SIM_port_cfg.h ├── SIM_port_ibm.h ├── SIM_port_raw.h ├── SIM_reg.c ├── SIM_reg.h ├── SIM_router.c ├── SIM_router.h ├── SIM_router_area.c ├── SIM_router_area.h ├── SIM_router_model.h ├── SIM_router_power.c ├── SIM_router_power.h ├── SIM_static.c ├── SIM_static.h ├── SIM_technology.h ├── SIM_technology_v1.h ├── SIM_technology_v2.h ├── SIM_technology_v2_NEW.h ├── SIM_time.c ├── SIM_time.h ├── SIM_util.c ├── SIM_util.h ├── SVM.m ├── SVM.sh ├── SWVC.c ├── SWVC.h ├── XBAR.c ├── XBAR.h ├── closesignal ├── dace │ ├── Contents.m │ ├── changelog │ ├── corrcubic.m │ ├── correxp.m │ ├── correxpg.m │ ├── corrgauss.m │ ├── corrlin.m │ ├── corrspherical.m │ ├── corrspline.m │ ├── dace.pdf │ ├── dacefit.m │ ├── data1.mat │ ├── dsmerge.m │ ├── gridsamp.m │ ├── lhsamp.m │ ├── predictor.m │ ├── regpoly0.m │ ├── regpoly1.m │ └── regpoly2.m ├── default_selected_area_45.txt ├── default_selected_area_65.txt ├── default_selected_power_45.txt ├── default_selected_power_65.txt ├── int_pow.txt ├── leak_pow.txt ├── libsvm-3.12 │ └── libsvm-3.12 │ │ ├── COPYRIGHT │ │ ├── FAQ.html │ │ ├── Makefile │ │ ├── Makefile.win │ │ ├── README │ │ ├── heart_scale │ │ ├── java │ │ ├── Makefile │ │ ├── libsvm.jar │ │ ├── libsvm │ │ │ ├── svm.java │ │ │ ├── svm.m4 │ │ │ ├── svm_model.java │ │ │ ├── svm_node.java │ │ │ ├── svm_parameter.java │ │ │ ├── svm_print_interface.java │ │ │ └── svm_problem.java │ │ ├── svm_predict.java │ │ ├── svm_scale.java │ │ ├── svm_toy.java │ │ ├── svm_train.java │ │ └── test_applet.html │ │ ├── matlab │ │ ├── Makefile │ │ ├── README │ │ ├── libsvmread.c │ │ ├── libsvmread.mexw32 │ │ ├── libsvmwrite.c │ │ ├── libsvmwrite.mexw32 │ │ ├── make.m │ │ ├── svm_model_matlab.c │ │ ├── svm_model_matlab.h │ │ ├── svmpredict.c │ │ ├── svmpredict.mexw32 │ │ ├── svmtrain.c │ │ └── svmtrain.mexw32 │ │ ├── python │ │ ├── Makefile │ │ ├── README │ │ ├── svm.py │ │ └── svmutil.py │ │ ├── svm-predict.c │ │ ├── svm-scale.c │ │ ├── svm-toy │ │ ├── gtk │ │ │ ├── Makefile │ │ │ ├── callbacks.cpp │ │ │ ├── callbacks.h │ │ │ ├── interface.c │ │ │ ├── interface.h │ │ │ ├── main.c │ │ │ └── svm-toy.glade │ │ ├── qt │ │ │ ├── Makefile │ │ │ └── svm-toy.cpp │ │ └── windows │ │ │ └── svm-toy.cpp │ │ ├── svm-train.c │ │ ├── svm.cpp │ │ ├── svm.def │ │ ├── svm.h │ │ ├── tools │ │ ├── README │ │ ├── checkdata.py │ │ ├── easy.py │ │ ├── grid.py │ │ └── subset.py │ │ └── windows │ │ ├── libsvm.dll │ │ ├── libsvmread.mexw32 │ │ ├── libsvmread.mexw64 │ │ ├── libsvmwrite.mexw32 │ │ ├── libsvmwrite.mexw64 │ │ ├── make.m │ │ ├── svm-predict.exe │ │ ├── svm-scale.exe │ │ ├── svm-toy.exe │ │ ├── svm-train.exe │ │ ├── svmpredict.mexw32 │ │ ├── svmpredict.mexw64 │ │ ├── svmtrain.mexw32 │ │ └── svmtrain.mexw64 ├── mainpage.h ├── makeInfo.txt ├── online_users ├── orion_router.c ├── output.txt ├── params.txt ├── print_params.sh ├── rbf2 │ ├── INSTALL.txt │ ├── NOTES.txt │ ├── delve-1.1p3.tar.gz │ ├── delve-1.1p3 │ │ └── delve-1.1p3 │ │ │ ├── CHANGES │ │ │ ├── Makefile.in │ │ │ ├── README │ │ │ ├── configure │ │ │ ├── configure.in │ │ │ ├── copyright │ │ │ ├── delve.h │ │ │ ├── delveAnova.c │ │ │ ├── delveAppInit.c │ │ │ ├── delveAttr.c │ │ │ ├── delveMatrix.c │ │ │ ├── delveRandom.c │ │ │ ├── delveStats.c │ │ │ ├── doc │ │ │ ├── GetMatrix.tex │ │ │ ├── Makefile.in │ │ │ ├── appA.tex │ │ │ ├── appB.tex │ │ │ ├── appC.tex │ │ │ ├── appD.tex │ │ │ ├── d_attr.tex │ │ │ ├── d_matrix.tex │ │ │ ├── d_random.tex │ │ │ ├── dd.eps │ │ │ ├── dd.fig │ │ │ ├── delvesh.tex │ │ │ ├── manual.ps │ │ │ ├── manual.tex │ │ │ ├── manual2.ps │ │ │ ├── mystyle.sty │ │ │ ├── sec1.tex │ │ │ ├── sec2.tex │ │ │ ├── sec3.tex │ │ │ ├── sec4.tex │ │ │ ├── sec5.tex │ │ │ ├── sec6.tex │ │ │ ├── sec7.tex │ │ │ └── sec8.tex │ │ │ ├── install-sh │ │ │ ├── library │ │ │ ├── acdc.tcl │ │ │ ├── dataset.tcl │ │ │ ├── delve.tcl │ │ │ ├── init.tcl │ │ │ ├── loss.tcl │ │ │ ├── matrix.tcl │ │ │ ├── path.tcl │ │ │ ├── prototask.tcl │ │ │ ├── randList.tcl │ │ │ ├── range.tcl │ │ │ ├── root.tcl │ │ │ ├── taskGen.tcl │ │ │ ├── taskInfo.tcl │ │ │ ├── tclIndex │ │ │ └── utils.tcl │ │ │ ├── mkdirhier-sh │ │ │ ├── patchlevel.h │ │ │ ├── tests │ │ │ ├── README │ │ │ ├── all │ │ │ ├── copyright │ │ │ ├── d_attr.test │ │ │ ├── d_matrix.test │ │ │ ├── d_random.test │ │ │ ├── defs │ │ │ ├── license.terms │ │ │ └── range.test │ │ │ ├── todo │ │ │ └── utils │ │ │ ├── copyright │ │ │ ├── dgenorder │ │ │ ├── dgenproto │ │ │ ├── dinfo │ │ │ ├── dls │ │ │ ├── dmore │ │ │ ├── mgendata │ │ │ ├── mgendir │ │ │ ├── minfo │ │ │ ├── mloss │ │ │ ├── mls │ │ │ ├── mmore │ │ │ └── mstats │ ├── demo │ │ ├── Contents.m │ │ ├── demo_get_data.m │ │ ├── demo_rbf_fs_2.m │ │ ├── demo_rbf_rr_2.m │ │ ├── demo_rbf_rt_1.m │ │ └── demo_rbf_rt_2.m │ ├── man │ │ ├── examples │ │ │ ├── get_data │ │ │ │ ├── fig1.m │ │ │ │ └── fig2.m │ │ │ ├── get_tmr │ │ │ │ └── fig1.m │ │ │ ├── grow_tree │ │ │ │ └── fig12.m │ │ │ ├── intro │ │ │ │ ├── fig1.m │ │ │ │ ├── fig3.m │ │ │ │ └── fig4.m │ │ │ ├── plot_ras │ │ │ │ ├── fig2a.m │ │ │ │ ├── fig2b.m │ │ │ │ └── fig3.m │ │ │ ├── rbf_dm │ │ │ │ ├── fig1.m │ │ │ │ ├── fig2.m │ │ │ │ └── fig3.m │ │ │ ├── rbf_fs_2 │ │ │ │ ├── fig1.m │ │ │ │ └── fig2.m │ │ │ ├── rbf_rr_2 │ │ │ │ ├── fig1.m │ │ │ │ ├── fig2.m │ │ │ │ └── fig3.m │ │ │ ├── rbf_rt_1 │ │ │ │ ├── fig1.m │ │ │ │ ├── fig2.m │ │ │ │ └── friedman.m │ │ │ └── rbf_rt_2 │ │ │ │ ├── fig1.m │ │ │ │ └── fig2.m │ │ ├── intro.pdf │ │ ├── intro.ps │ │ ├── manual.pdf │ │ └── manual.ps │ ├── meth │ │ ├── Contents.m │ │ ├── rbf_fs_2.m │ │ ├── rbf_rr_2.m │ │ ├── rbf_rt_1.m │ │ └── rbf_rt_2.m │ ├── perl │ │ └── mstats.pl │ └── util │ │ ├── Contents.m │ │ ├── conf_check.m │ │ ├── conf_print.m │ │ ├── get_data.m │ │ ├── get_data.mat │ │ ├── get_fig.m │ │ ├── get_tmr.m │ │ ├── grow_tree.m │ │ ├── inc_tmr.m │ │ ├── isstring.m │ │ ├── plot_ras.m │ │ ├── pred_tree.m │ │ ├── rbf_dm.m │ │ ├── rbf_ver.m │ │ ├── run_demo.m │ │ └── tree_rbf.m ├── router.c ├── router.h ├── router_area.c ├── router_area.h ├── router_power.c ├── router_power.h ├── selected_area_45.txt ├── selected_area_65.txt ├── selected_power_45.txt ├── selected_power_65.txt ├── sw_pow.txt ├── technology_area_power.h ├── test.c ├── test.txt ├── test_alu.c ├── test_permu.c ├── total_area.txt └── total_pow.txt ├── Parameters ├── MacroParam.json ├── NNParam.txt ├── NeuronsynpaseParam.json ├── OptParam.json ├── SpecParam.json ├── SpecboundParam.json ├── TechnodeParam.json ├── duplication.txt ├── epoch.json ├── layer.txt ├── layerconnect.txt ├── mapping.txt ├── meshconnect.txt ├── prepare.txt ├── tileNum.txt ├── traffic.txt └── trainParam.json ├── Performance ├── HtreePerf.json ├── MacroPerf.json ├── MaxPoolPerf.json ├── MeshPerf.json ├── ReluPerf.json ├── SFU_performance.txt ├── SPMPerf.json ├── SigmoidPerf.json └── performance.txt ├── Weight └── readme.md ├── cacti-master ├── -rwx ├── 2DDRAM_Samsung2GbDDR2.cfg ├── 2DDRAM_micron1Gb.cfg ├── 3DDRAM_Samsung3D8Gb_extened.cfg ├── README ├── TSV.cc ├── TSV.h ├── Ucache.cc ├── Ucache.h ├── arbiter.cc ├── arbiter.h ├── area.cc ├── area.h ├── bank.cc ├── bank.h ├── basic_circuit.cc ├── basic_circuit.h ├── bufferInfo.txt ├── cache.cfg ├── cache.cfg.out ├── cache_bak.cfg ├── cache_bak.cfg.out ├── cacti.i ├── cacti.mk ├── cacti_interface.cc ├── cacti_interface.h ├── component.cc ├── component.h ├── const.h ├── contention.dat ├── crossbar.cc ├── crossbar.h ├── ddr3.cfg ├── decoder.cc ├── decoder.h ├── dram.cfg ├── extio.cc ├── extio.h ├── extio_technology.cc ├── extio_technology.h ├── htree2.cc ├── htree2.h ├── io.cc ├── io.h ├── lpddr.cfg ├── main.cc ├── makefile ├── mat.cc ├── mat.h ├── memcad.cc ├── memcad.h ├── memcad_parameters.cc ├── memcad_parameters.h ├── memorybus.cc ├── memorybus.h ├── nuca.cc ├── nuca.h ├── output.txt ├── parameter.cc ├── parameter.h ├── performance.txt ├── powergating.cc ├── powergating.h ├── register.cfg ├── regression.test ├── router.cc ├── router.h ├── sample_config_files │ ├── ddr3_cache.cfg │ ├── diff_ddr3_cache.cfg │ ├── lpddr3_cache.cfg │ └── wideio_cache.cfg ├── subarray.cc ├── subarray.h ├── tech_params │ ├── 16nm.dat │ ├── 180nm-old.dat │ ├── 180nm.dat │ ├── 22nm.dat │ ├── 32nm.dat │ ├── 45nm.dat │ ├── 65nm-old.dat │ ├── 65nm.dat │ ├── 90nm-old.dat │ └── 90nm.dat ├── technology.cc ├── uca.cc ├── uca.h ├── version_cacti.h ├── wire.cc └── wire.h ├── datasets └── readme.md ├── defect ├── Vgg_l1.pth ├── Vgg_l10.pth ├── Vgg_l11.pth ├── Vgg_l2.pth ├── Vgg_l3.pth ├── Vgg_l4.pth ├── Vgg_l5.pth ├── Vgg_l6.pth ├── Vgg_l7.pth ├── Vgg_l8.pth └── Vgg_l9.pth ├── docs └── manual.pdf ├── generate_data └── tcad │ ├── accuracy_out │ └── accuracy_out1.txt │ ├── circuit_out │ └── circuit_out1.txt │ ├── mapping_out │ └── mapping_out1.txt │ ├── performance_out │ └── performance_out1.txt │ └── readme.md ├── readme.md └── src ├── Accuracy_optimizer.py ├── Bayesian ├── .coveragerc ├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── bayes │ ├── __init__.py │ ├── bayesian_optimization.py │ ├── domain_reduction.py │ ├── event.py │ ├── logger.py │ ├── observer.py │ ├── target_space.py │ └── util.py ├── examples │ ├── advanced-tour.ipynb │ ├── async_optimization.py │ ├── basic-tour.ipynb │ ├── bayesian_optimization.gif │ ├── bo_example.png │ ├── domain_reduction.ipynb │ ├── exploitation_vs_exploration.ipynb │ ├── func.png │ ├── sdr.png │ ├── sklearn_example.py │ └── visualization.ipynb ├── pytest.ini ├── setup.cfg ├── setup.py └── tests │ ├── test_acceptance.py │ ├── test_bayesian_optimization.py │ ├── test_logs.json │ ├── test_observer.py │ ├── test_queue.py │ ├── test_seq_domain_red.py │ ├── test_target_space.py │ └── test_util.py ├── Buffer_module.py ├── Circuit_optimizer.py ├── HardwareVMM.py ├── IRdrop.py ├── Mapping_optimizer.py ├── Network.py ├── NoC_orion.py ├── Parameters.py ├── Performance_optimizer.py ├── Specification_optimizer.py ├── data_transmiss ├── PyActInput.txt ├── PyInput.txt ├── PyParam.txt └── PyWeight.txt ├── frozen_dir.py ├── models ├── LeNet5.py ├── densenet.py ├── googlenet.py ├── inceptionv3.py ├── mobilenet.py ├── mobilenetv2.py ├── resnet.py ├── resnext.py ├── squeezenet.py ├── stgcn.py ├── vgg.py └── xception.py ├── refactor ├── CMakeLists.txt ├── CoMN_Sim │ ├── .gitignore │ ├── include │ │ ├── Adder.h │ │ ├── BasicUnit.h │ │ ├── BitShifter.h │ │ ├── Comparator.h │ │ ├── CurrentSenseAmp.h │ │ ├── DFF.h │ │ ├── DecoderDriver.h │ │ ├── MaxPool.h │ │ ├── MultilevelSAEncoder.h │ │ ├── MultilevelSenseAmp.h │ │ ├── Mux.h │ │ ├── MuxDecoder.h │ │ ├── NewDecoderDriver.h │ │ ├── NewSwitchMatrix.h │ │ ├── Precharger.h │ │ ├── SRAMWriteDriver.h │ │ ├── SarADC.h │ │ ├── SenseAmp.h │ │ ├── ShiftAdder.h │ │ ├── Sigmoid.h │ │ ├── SwitchMatrix.h │ │ ├── SynapticArray.h │ │ ├── VoltageSenseAmp.h │ │ └── general │ │ │ ├── Constant.h │ │ │ ├── Formula.h │ │ │ ├── MemCell.h │ │ │ ├── Param.h │ │ │ ├── Technology.h │ │ │ └── Types.h │ └── src │ │ ├── Adder.cpp │ │ ├── BasicUnit.cpp │ │ ├── BitShifter.cpp │ │ ├── Comparator.cpp │ │ ├── CurrentSenseAmp.cpp │ │ ├── DFF.cpp │ │ ├── DecoderDriver.cpp │ │ ├── MaxPool.cpp │ │ ├── MultilevelSAEncoder.cpp │ │ ├── MultilevelSenseAmp.cpp │ │ ├── Mux.cpp │ │ ├── MuxDecoder.cpp │ │ ├── NewDecoderDriver.cpp │ │ ├── NewSwitchMatrix.cpp │ │ ├── Precharger.cpp │ │ ├── SRAMWriteDriver.cpp │ │ ├── SarADC.cpp │ │ ├── SenseAmp.cpp │ │ ├── ShiftAdder.cpp │ │ ├── Sigmoid.cpp │ │ ├── SwitchMatrix.cpp │ │ ├── SynapticArray.cpp │ │ ├── VoltageSenseAmp.cpp │ │ └── general │ │ ├── Formula.cpp │ │ ├── Param.cpp │ │ └── Technology.cpp ├── Mapping.cpp ├── Mapping.h ├── Mesh_Placing.cpp ├── Mesh_Placing.h ├── PE.cpp ├── PE.h ├── Perf_Evaluator.cpp ├── Perf_Evaluator.h ├── PyActInput.cpp ├── PyActInput.h ├── PyInput.cpp ├── PyInput.h ├── PyParam.cpp ├── PyParam.h ├── PyWeight.cpp ├── PyWeight.h ├── defines.h ├── json.hpp ├── main.cpp ├── run.sh ├── test │ ├── mesh_test.txt │ └── test_partition.txt ├── tests.cpp └── tests.h ├── retrain_modules.py └── utils.py /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | .idea/ 3 | __pycache__/ 4 | src/refactor/build 5 | datasets/cifar-10-batches-py 6 | datasets/MNIST 7 | Weight/tcad -------------------------------------------------------------------------------- /Images/image.pth: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/Images/image.pth -------------------------------------------------------------------------------- /Images/image_mnist.pth: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/Images/image_mnist.pth -------------------------------------------------------------------------------- /Images/readme.md: -------------------------------------------------------------------------------- 1 | METR-LA dataset (including adj_mat.npy and node_values.npy) should be downloaded manually into this directory. -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 booniebears 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ORION3_0/ARESLab/ARESLab.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/ORION3_0/ARESLab/ARESLab.pdf -------------------------------------------------------------------------------- /ORION3_0/ARESLab/aresbuild.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/ORION3_0/ARESLab/aresbuild.m -------------------------------------------------------------------------------- /ORION3_0/ARESLab/aresparams.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/ORION3_0/ARESLab/aresparams.m -------------------------------------------------------------------------------- /ORION3_0/KG.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -f 2 | TRAINPATHA=$1 3 | TRAINPATHP=$2 4 | DIR=`pwd` 5 | rm selected_area_65.txt selected_area_45.txt 6 | if [ $TRAINPATHA = "default" ] 7 | then 8 | cp $DIR/default_selected_area_65.txt selected_area_65.txt 9 | cp $DIR/default_selected_area_45.txt selected_area_45.txt 10 | else 11 | cp $TRAINPATHA selected_area_65.txt 12 | cp $TRAINPATHA selected_area_45.txt 13 | fi 14 | if [ $TRAINPATHP = "default" ] 15 | then 16 | cp $DIR/default_selected_power_65.txt selected_power_65.txt 17 | cp $DIR/default_selected_power_45.txt selected_power_45.txt 18 | else 19 | cp $TRAINPATHP selected_power_65.txt 20 | cp $TRAINPATHP selected_power_45.txt 21 | fi 22 | rm int_pow.txt leak_pow.txt sw_pow.txt total_area.txt total_pow.txt 23 | matlab -nodisplay -nodesktop -r KG 24 | while [ ! -f total_pow.txt ] 25 | do 26 | sleep .001s 27 | done 28 | STRING=`awk 'END {print $1}' total_pow.txt` 29 | while [[ "ABKGROUP_ORION" != $STRING ]] 30 | do 31 | sleep .001s 32 | STRING=`awk 'END {print $1}' total_pow.txt` 33 | done 34 | file_end=`awk 'END { print NR }' total_pow.txt` 35 | echo -e "B\tV\tP\tF\tTotal Area:\tInternal Power:\tSwitching Power:\tLeakage Power:\tTotal Power:" 36 | for ((i=1; i<$file_end;i++)) 37 | do 38 | B=`awk -v j=$((i+1)) 'FNR == j {print $1}' params.txt` 39 | V=`awk -v j=$((i+1)) 'FNR == j {print $2}' params.txt` 40 | P=`awk -v j=$((i+1)) 'FNR == j {print $3}' params.txt` 41 | F=`awk -v j=$((i+1)) 'FNR == j {print $4}' params.txt` 42 | TOTAL_AREA=`awk -v j=$i 'FNR == j' total_area.txt` 43 | INT=`awk -v j=$i 'FNR == j' int_pow.txt` 44 | SW=`awk -v j=$i 'FNR == j' sw_pow.txt` 45 | LEAK=`awk -v j=$i 'FNR == j' leak_pow.txt` 46 | TOTAL_POWER=`awk -v j=$i 'FNR == j' total_pow.txt` 47 | echo -e "$B\t$V\t$P\t$F\t$TOTAL_AREA\t$INT\t$SW\t$LEAK\t$TOTAL_POWER" 48 | done -------------------------------------------------------------------------------- /ORION3_0/LSQR.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -f 2 | TRAINPATHA=$1 3 | TRAINPATHP=$2 4 | DIR=`pwd` 5 | rm selected_area_65.txt selected_area_45.txt 6 | if [ $TRAINPATHA = "default" ] 7 | then 8 | cp $DIR/default_selected_area_65.txt selected_area_65.txt 9 | cp $DIR/default_selected_area_45.txt selected_area_45.txt 10 | else 11 | cp $TRAINPATHA selected_area_65.txt 12 | cp $TRAINPATHA selected_area_45.txt 13 | fi 14 | if [ $TRAINPATHP = "default" ] 15 | then 16 | cp $DIR/default_selected_power_65.txt selected_power_65.txt 17 | cp $DIR/default_selected_power_45.txt selected_power_45.txt 18 | else 19 | cp $TRAINPATHP selected_power_65.txt 20 | cp $TRAINPATHP selected_power_45.txt 21 | fi 22 | rm int_pow.txt leak_pow.txt sw_pow.txt total_area.txt total_pow.txt 23 | matlab -nodisplay -nodesktop -r LSQR 24 | while [ ! -f total_pow.txt ] 25 | do 26 | sleep .001s 27 | done 28 | STRING=`awk 'END {print $1}' total_pow.txt` 29 | while [[ "ABKGROUP_ORION" != $STRING ]] 30 | do 31 | sleep .001s 32 | STRING=`awk 'END {print $1}' total_pow.txt` 33 | done 34 | file_end=`awk 'END { print NR }' total_pow.txt` 35 | echo -e "B\tV\tP\tF\tTotal Area:\tInternal Power:\tSwitching Power:\tLeakage Power:\tTotal Power:" 36 | for ((i=1; i<$file_end;i++)) 37 | do 38 | B=`awk -v j=$((i+1)) 'FNR == j {print $1}' params.txt` 39 | V=`awk -v j=$((i+1)) 'FNR == j {print $2}' params.txt` 40 | P=`awk -v j=$((i+1)) 'FNR == j {print $3}' params.txt` 41 | F=`awk -v j=$((i+1)) 'FNR == j {print $4}' params.txt` 42 | TOTAL_AREA=`awk -v j=$i 'FNR == j' total_area.txt` 43 | INT=`awk -v j=$i 'FNR == j' int_pow.txt` 44 | SW=`awk -v j=$i 'FNR == j' sw_pow.txt` 45 | LEAK=`awk -v j=$i 'FNR == j' leak_pow.txt` 46 | TOTAL_POWER=`awk -v j=$i 'FNR == j' total_pow.txt` 47 | echo -e "$B\t$V\t$P\t$F\t$TOTAL_AREA\t$INT\t$SW\t$LEAK\t$TOTAL_POWER" 48 | done -------------------------------------------------------------------------------- /ORION3_0/MARS.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -f 2 | TRAINPATHA=$1 3 | TRAINPATHP=$2 4 | DIR=`pwd` 5 | rm selected_area_65.txt selected_area_45.txt 6 | if [ $TRAINPATHA = "default" ] 7 | then 8 | cp $DIR/default_selected_area_65.txt selected_area_65.txt 9 | cp $DIR/default_selected_area_45.txt selected_area_45.txt 10 | else 11 | cp $TRAINPATHA selected_area_65.txt 12 | cp $TRAINPATHA selected_area_45.txt 13 | fi 14 | if [ $TRAINPATHP = "default" ] 15 | then 16 | cp $DIR/default_selected_power_65.txt selected_power_65.txt 17 | cp $DIR/default_selected_power_45.txt selected_power_45.txt 18 | else 19 | cp $TRAINPATHP selected_power_65.txt 20 | cp $TRAINPATHP selected_power_45.txt 21 | fi 22 | rm int_pow.txt leak_pow.txt sw_pow.txt total_area.txt total_pow.txt 23 | matlab -nodisplay -nodesktop -r MARS 24 | while [ ! -f total_pow.txt ] 25 | do 26 | sleep .001s 27 | done 28 | STRING=`awk 'END {print $1}' total_pow.txt` 29 | while [[ "ABKGROUP_ORION" != $STRING ]] 30 | do 31 | sleep .001s 32 | STRING=`awk 'END {print $1}' total_pow.txt` 33 | done 34 | file_end=`awk 'END { print NR }' total_pow.txt` 35 | echo -e "B\tV\tP\tF\tTotal Area\tInternal Power\tSwitching Power\tLeakage Power\tTotal Power" 36 | for ((i=1; i<$file_end;i++)) 37 | do 38 | B=`awk -v j=$((i+1)) 'FNR == j {print $1}' params.txt` 39 | V=`awk -v j=$((i+1)) 'FNR == j {print $2}' params.txt` 40 | P=`awk -v j=$((i+1)) 'FNR == j {print $3}' params.txt` 41 | F=`awk -v j=$((i+1)) 'FNR == j {print $4}' params.txt` 42 | TOTAL_AREA=`awk -v j=$i 'FNR == j' total_area.txt` 43 | INT=`awk -v j=$i 'FNR == j' int_pow.txt` 44 | SW=`awk -v j=$i 'FNR == j' sw_pow.txt` 45 | LEAK=`awk -v j=$i 'FNR == j' leak_pow.txt` 46 | TOTAL_POWER=`awk -v j=$i 'FNR == j' total_pow.txt` 47 | echo -e "$B\t$V\t$P\t$F\t$TOTAL_AREA\t$INT\t$SW\t$LEAK\t$TOTAL_POWER" 48 | done -------------------------------------------------------------------------------- /ORION3_0/Makefile: -------------------------------------------------------------------------------- 1 | #CC = /usr/bin/gcc-3.4 2 | 3 | #CFLAGS = -I. $(DEFS) -O3 -Wno-deprecated 4 | CFLAGS = -I. $(DEFS) -g -DTECHNEW 5 | 6 | ##AR = ar 7 | ##RANLIB = ranlib 8 | 9 | ROUTER_MODEL = SIM_router.c SIM_arbiter.c SIM_crossbar.c router.c SWVC.c XBAR.c INBUF.c OUTBUF.c CLKCTRL.c NONPR.c 10 | POWER_MODEL = SIM_router_power.c router_power.c 11 | LINK_MODEL = SIM_link.c 12 | CLOCK_MODEL = SIM_clock.c 13 | AREA_MODEL = SIM_router_area.c router_area.c 14 | ARRAY_MODEL = SIM_array_l.c SIM_array_m.c SIM_cam.c 15 | ALU_MODEL = SIM_ALU.c 16 | OTHER_MODEL = SIM_misc.c SIM_permu.c 17 | STATIC_MODEL = SIM_static.c 18 | MISC_SRC = SIM_util.c SIM_time.c 19 | 20 | SRCS = $(ARRAY_MODEL) $(ROUTER_MODEL) $(POWER_MODEL) $(ALU_MODEL) $(OTHER_MODEL) \ 21 | $(STATIC_MODEL) $(LINK_MODEL) $(CLOCK_MODEL) $(MISC_SRC) $(AREA_MODEL) 22 | 23 | OBJS = $(SRCS:.c=.o) 24 | 25 | 26 | all: 27 | @make orion_router 28 | 29 | TEST_SRCS = orion_router.c test_permu.c test_alu.c dump_para.c 30 | TEST_EXEC = $(TEST_SRCS:.c=) 31 | MODULE_SRCS = SIM_router_power.c router_power.c router_area.c 32 | ALL_SRCS = $(SRCS) $(TEST_SRCS) $(MODULE_SRCS) 33 | ALL_OBJS = $(ALL_SRCS:.c=.o) 34 | 35 | orion_router: orion_router.o router_power.o router_area.o SIM_router_power.o $(OBJS) 36 | @$(CC) $(CFLAGS) -no-pie -o $@ $^ -lm 37 | 38 | test_permu: test_permu.o $(OBJS) 39 | @$(CC) $(CFLAGS) -no-pie -o $@ $^ -lm 40 | 41 | test_alu: test_alu.o $(OBJS) 42 | @$(CC) $(CFLAGS) -o $@ $^ -lm 43 | 44 | dump_para: dump_para.o $(OBJS) 45 | @$(CC) $(CFLAGS) -o $@ $^ -lm 46 | 47 | clean: 48 | @$(RM) $(ALL_OBJS) $(TEST_EXEC) *~ *.bak core -------------------------------------------------------------------------------- /ORION3_0/NeuroSIM.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/ORION3_0/NeuroSIM.txt -------------------------------------------------------------------------------- /ORION3_0/RBF.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -f 2 | TRAINPATHA=$1 3 | TRAINPATHP=$2 4 | DIR=`pwd` 5 | rm selected_area_65.txt selected_area_45.txt 6 | if [ $TRAINPATHA = "default" ] 7 | then 8 | cp $DIR/default_selected_area_65.txt selected_area_65.txt 9 | cp $DIR/default_selected_area_45.txt selected_area_45.txt 10 | else 11 | cp $TRAINPATHA selected_area_65.txt 12 | cp $TRAINPATHA selected_area_45.txt 13 | fi 14 | if [ $TRAINPATHP = "default" ] 15 | then 16 | cp $DIR/default_selected_power_65.txt selected_power_65.txt 17 | cp $DIR/default_selected_power_45.txt selected_power_45.txt 18 | else 19 | cp $TRAINPATHP selected_power_65.txt 20 | cp $TRAINPATHP selected_power_45.txt 21 | fi 22 | rm int_pow.txt leak_pow.txt sw_pow.txt total_area.txt total_pow.txt 23 | matlab -nodisplay -nodesktop -r RBF 24 | while [ ! -f total_pow.txt ] 25 | do 26 | sleep .001s 27 | done 28 | STRING=`awk 'END {print $1}' total_pow.txt` 29 | while [[ "ABKGROUP_ORION" != $STRING ]] 30 | do 31 | sleep .001s 32 | STRING=`awk 'END {print $1}' total_pow.txt` 33 | done 34 | file_end=`awk 'END { print NR }' total_pow.txt` 35 | echo -e "B\tV\tP\tF\tTotal Area:\tInternal Power:\tSwitching Power:\tLeakage Power:\tTotal Power:" 36 | for ((i=1; i<$file_end;i++)) 37 | do 38 | B=`awk -v j=$((i+1)) 'FNR == j {print $1}' params.txt` 39 | V=`awk -v j=$((i+1)) 'FNR == j {print $2}' params.txt` 40 | P=`awk -v j=$((i+1)) 'FNR == j {print $3}' params.txt` 41 | F=`awk -v j=$((i+1)) 'FNR == j {print $4}' params.txt` 42 | TOTAL_AREA=`awk -v j=$i 'FNR == j' total_area.txt` 43 | INT=`awk -v j=$i 'FNR == j' int_pow.txt` 44 | SW=`awk -v j=$i 'FNR == j' sw_pow.txt` 45 | LEAK=`awk -v j=$i 'FNR == j' leak_pow.txt` 46 | TOTAL_POWER=`awk -v j=$i 'FNR == j' total_pow.txt` 47 | echo -e "$B\t$V\t$P\t$F\t$TOTAL_AREA\t$INT\t$SW\t$LEAK\t$TOTAL_POWER" 48 | done -------------------------------------------------------------------------------- /ORION3_0/SIM_clock.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------- 2 | * ORION 2.0 3 | * 4 | * Copyright 2009 5 | * Princeton University, and Regents of the University of California 6 | * All Rights Reserved 7 | * 8 | * 9 | * ORION 2.0 was developed by Bin Li at Princeton University and Kambiz Samadi at 10 | * University of California, San Diego. ORION 2.0 was built on top of ORION 1.0. 11 | * ORION 1.0 was developed by Hangsheng Wang, Xinping Zhu and Xuning Chen at 12 | * Princeton University. 13 | * 14 | * If your use of this software contributes to a published paper, we 15 | * request that you cite our paper that appears on our website 16 | * http://www.princeton.edu/~peh/orion.html 17 | * 18 | * Permission to use, copy, and modify this software and its documentation is 19 | * granted only under the following terms and conditions. Both the 20 | * above copyright notice and this permission notice must appear in all copies 21 | * of the software, derivative works or modified versions, and any portions 22 | * thereof, and both notices must appear in supporting documentation. 23 | * 24 | * This software may be distributed (but not offered for sale or transferred 25 | * for compensation) to third parties, provided such third parties agree to 26 | * abide by the terms and conditions of this notice. 27 | * 28 | * This software is distributed in the hope that it will be useful to the 29 | * community, but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 31 | * 32 | *-----------------------------------------------------------------------*/ 33 | 34 | #ifndef _SIM_CLOCK_POWER_H 35 | #define _SIM_CLOCK_POWER_H 36 | 37 | #include "SIM_array.h" 38 | #include "SIM_router.h" 39 | 40 | double SIM_total_clockEnergy(SIM_router_info_t *info, SIM_router_power_t *router); 41 | double fpfp_clock_cap(); 42 | 43 | #endif /* _SIM_CLOCK_POWER_H */ 44 | -------------------------------------------------------------------------------- /ORION3_0/SIM_permu_model.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------- 2 | * ORION 2.0 3 | * 4 | * Copyright 2009 5 | * Princeton University, and Regents of the University of California 6 | * All Rights Reserved 7 | * 8 | * 9 | * ORION 2.0 was developed by Bin Li at Princeton University and Kambiz Samadi at 10 | * University of California, San Diego. ORION 2.0 was built on top of ORION 1.0. 11 | * ORION 1.0 was developed by Hangsheng Wang, Xinping Zhu and Xuning Chen at 12 | * Princeton University. 13 | * 14 | * If your use of this software contributes to a published paper, we 15 | * request that you cite our paper that appears on our website 16 | * http://www.princeton.edu/~peh/orion.html 17 | * 18 | * Permission to use, copy, and modify this software and its documentation is 19 | * granted only under the following terms and conditions. Both the 20 | * above copyright notice and this permission notice must appear in all copies 21 | * of the software, derivative works or modified versions, and any portions 22 | * thereof, and both notices must appear in supporting documentation. 23 | * 24 | * This software may be distributed (but not offered for sale or transferred 25 | * for compensation) to third parties, provided such third parties agree to 26 | * abide by the terms and conditions of this notice. 27 | * 28 | * This software is distributed in the hope that it will be useful to the 29 | * community, but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 31 | * 32 | *-----------------------------------------------------------------------*/ 33 | 34 | #ifndef _SIM_PERMU_MODEL_H 35 | #define _SIM_PERMU_MODEL_H 36 | 37 | typedef enum { 38 | OMFLIP_PERMU = 1, 39 | GRP_PERMU, 40 | PERMU_MAX_MODEL 41 | } SIM_power_permu_model_t; 42 | 43 | #endif /* _SIM_PERMU_MODEL_H */ 44 | 45 | -------------------------------------------------------------------------------- /ORION3_0/SIM_router_area.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------- 2 | * ORION 2.0 3 | * 4 | * Copyright 2009 5 | * Princeton University, and Regents of the University of California 6 | * All Rights Reserved 7 | * 8 | * 9 | * ORION 2.0 was developed by Bin Li at Princeton University and Kambiz Samadi at 10 | * University of California, San Diego. ORION 2.0 was built on top of ORION 1.0. 11 | * ORION 1.0 was developed by Hangsheng Wang, Xinping Zhu and Xuning Chen at 12 | * Princeton University. 13 | * 14 | * If your use of this software contributes to a published paper, we 15 | * request that you cite our paper that appears on our website 16 | * http://www.princeton.edu/~peh/orion.html 17 | * 18 | * Permission to use, copy, and modify this software and its documentation is 19 | * granted only under the following terms and conditions. Both the 20 | * above copyright notice and this permission notice must appear in all copies 21 | * of the software, derivative works or modified versions, and any portions 22 | * thereof, and both notices must appear in supporting documentation. 23 | * 24 | * This software may be distributed (but not offered for sale or transferred 25 | * for compensation) to third parties, provided such third parties agree to 26 | * abide by the terms and conditions of this notice. 27 | * 28 | * This software is distributed in the hope that it will be useful to the 29 | * community, but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 31 | * 32 | *-----------------------------------------------------------------------*/ 33 | 34 | #ifndef _SIM_ROUTER_AREA_H 35 | #define _SIM_ROUTER_AREA_H 36 | 37 | 38 | #endif /* _SIM_POWER_ROUTER_H */ 39 | -------------------------------------------------------------------------------- /ORION3_0/SIM_router_power.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------- 2 | * ORION 2.0 3 | * 4 | * Copyright 2009 5 | * Princeton University, and Regents of the University of California 6 | * All Rights Reserved 7 | * 8 | * 9 | * ORION 2.0 was developed by Bin Li at Princeton University and Kambiz Samadi at 10 | * University of California, San Diego. ORION 2.0 was built on top of ORION 1.0. 11 | * ORION 1.0 was developed by Hangsheng Wang, Xinping Zhu and Xuning Chen at 12 | * Princeton University. 13 | * 14 | * If your use of this software contributes to a published paper, we 15 | * request that you cite our paper that appears on our website 16 | * http://www.princeton.edu/~peh/orion.html 17 | * 18 | * Permission to use, copy, and modify this software and its documentation is 19 | * granted only under the following terms and conditions. Both the 20 | * above copyright notice and this permission notice must appear in all copies 21 | * of the software, derivative works or modified versions, and any portions 22 | * thereof, and both notices must appear in supporting documentation. 23 | * 24 | * This software may be distributed (but not offered for sale or transferred 25 | * for compensation) to third parties, provided such third parties agree to 26 | * abide by the terms and conditions of this notice. 27 | * 28 | * This software is distributed in the hope that it will be useful to the 29 | * community, but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 31 | * 32 | *-----------------------------------------------------------------------*/ 33 | 34 | #ifndef _SIM_ROUTER_POWER_H 35 | #define _SIM_ROUTER_POWER_H 36 | 37 | #include "SIM_parameter.h" 38 | #include "SIM_router.h" 39 | 40 | #if (PARM(POWER_STATS)) 41 | 42 | 43 | /* function prototypes */ 44 | #endif /* PARM(POWER_STATS) */ 45 | 46 | #endif /* _SIM_ROUTER_POWER_H */ 47 | -------------------------------------------------------------------------------- /ORION3_0/SIM_static.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------- 2 | * ORION 2.0 3 | * 4 | * Copyright 2009 5 | * Princeton University, and Regents of the University of California 6 | * All Rights Reserved 7 | * 8 | * 9 | * ORION 2.0 was developed by Bin Li at Princeton University and Kambiz Samadi at 10 | * University of California, San Diego. ORION 2.0 was built on top of ORION 1.0. 11 | * ORION 1.0 was developed by Hangsheng Wang, Xinping Zhu and Xuning Chen at 12 | * Princeton University. 13 | * 14 | * If your use of this software contributes to a published paper, we 15 | * request that you cite our paper that appears on our website 16 | * http://www.princeton.edu/~peh/orion.html 17 | * 18 | * Permission to use, copy, and modify this software and its documentation is 19 | * granted only under the following terms and conditions. Both the 20 | * above copyright notice and this permission notice must appear in all copies 21 | * of the software, derivative works or modified versions, and any portions 22 | * thereof, and both notices must appear in supporting documentation. 23 | * 24 | * This software may be distributed (but not offered for sale or transferred 25 | * for compensation) to third parties, provided such third parties agree to 26 | * abide by the terms and conditions of this notice. 27 | * 28 | * This software is distributed in the hope that it will be useful to the 29 | * community, but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 31 | * 32 | *-----------------------------------------------------------------------*/ 33 | 34 | #ifndef _SIM_POWER_STATIC_H 35 | #define _SIM_POWER_STATIC_H 36 | 37 | #include "SIM_parameter.h" 38 | 39 | extern double NMOS_TAB[1]; 40 | extern double PMOS_TAB[1]; 41 | extern double NAND2_TAB[4]; 42 | extern double NOR2_TAB[4]; 43 | extern double DFF_TAB[1]; 44 | #endif /* _SIM_POWER_STATIC_H */ 45 | -------------------------------------------------------------------------------- /ORION3_0/SVM.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -f 2 | TRAINPATHA=$1 3 | TRAINPATHP=$2 4 | DIR=`pwd` 5 | rm selected_area_65.txt selected_area_45.txt 6 | if [ $TRAINPATHA = "default" ] 7 | then 8 | cp $DIR/default_selected_area_65.txt selected_area_65.txt 9 | cp $DIR/default_selected_area_45.txt selected_area_45.txt 10 | else 11 | cp $TRAINPATHA selected_area_65.txt 12 | cp $TRAINPATHA selected_area_45.txt 13 | fi 14 | if [ $TRAINPATHP = "default" ] 15 | then 16 | cp $DIR/default_selected_power_65.txt selected_power_65.txt 17 | cp $DIR/default_selected_power_45.txt selected_power_45.txt 18 | else 19 | cp $TRAINPATHP selected_power_65.txt 20 | cp $TRAINPATHP selected_power_45.txt 21 | fi 22 | rm int_pow.txt leak_pow.txt sw_pow.txt total_area.txt total_pow.txt 23 | matlab -nodisplay -nodesktop -r SVM 24 | while [ ! -f total_pow.txt ] 25 | do 26 | sleep .001s 27 | done 28 | STRING=`awk 'END {print $1}' total_pow.txt` 29 | while [[ "ABKGROUP_ORION" != $STRING ]] 30 | do 31 | sleep .001s 32 | STRING=`awk 'END {print $1}' total_pow.txt` 33 | done 34 | file_end=`awk 'END { print NR }' total_pow.txt` 35 | echo -e "B\tV\tP\tF\tTotal Area:\tInternal Power:\tSwitching Power:\tLeakage Power:\tTotal Power:" 36 | for ((i=1; i<$file_end;i++)) 37 | do 38 | B=`awk -v j=$((i+1)) 'FNR == j {print $1}' params.txt` 39 | V=`awk -v j=$((i+1)) 'FNR == j {print $2}' params.txt` 40 | P=`awk -v j=$((i+1)) 'FNR == j {print $3}' params.txt` 41 | F=`awk -v j=$((i+1)) 'FNR == j {print $4}' params.txt` 42 | TOTAL_AREA=`awk -v j=$i 'FNR == j' total_area.txt` 43 | INT=`awk -v j=$i 'FNR == j' int_pow.txt` 44 | SW=`awk -v j=$i 'FNR == j' sw_pow.txt` 45 | LEAK=`awk -v j=$i 'FNR == j' leak_pow.txt` 46 | TOTAL_POWER=`awk -v j=$i 'FNR == j' total_pow.txt` 47 | echo -e "$B\t$V\t$P\t$F\t$TOTAL_AREA\t$INT\t$SW\t$LEAK\t$TOTAL_POWER" 48 | done o "Total Power: $TOTAL" 49 | done -------------------------------------------------------------------------------- /ORION3_0/closesignal: -------------------------------------------------------------------------------- 1 | exit -------------------------------------------------------------------------------- /ORION3_0/dace/Contents.m: -------------------------------------------------------------------------------- 1 | % DACE (Design and Analysis of Computer Experiments) Toolbox 2 | % Version 2.5, September 4, 2002 3 | % Copyright (c) 2002 by Hans Bruun Nielsen and IMM. 4 | % 5 | % Model construction 6 | % dacefit - Constrained non-linear least-squares fit of a given 7 | % correlation model to the provided data set and 8 | % regression model. 9 | % 10 | % Model prediction 11 | % predictor - Model predictor with mean squared error estimate. 12 | % 13 | % Regression functions 14 | % regpoly0 - Zero order polynomial. 15 | % regpoly1 - First order polynomial. 16 | % regpoly2 - Second order polynomial. 17 | % 18 | % Correlation functions 19 | % corrcubic - Local support, cubic polynomial 20 | % correxp - Exponential. 21 | % correxpg - General exponential. 22 | % corrgauss - Gaussian. 23 | % corrlin - Local support, linear. 24 | % corrspherical - Local support, spherical. 25 | % corrspline - Local support, cubic spline. 26 | % 27 | % Experimental Design 28 | % gridsamp - Points in a regular grid. 29 | % lhsamp - Latin hypercube distributed random numbers. 30 | % 31 | % Auxiliary functions 32 | % dsmerge - Merge data for multiple design sites. 33 | % 34 | % Data files 35 | % data1.mat - Example data S and Y 36 | 37 | -------------------------------------------------------------------------------- /ORION3_0/dace/corrcubic.m: -------------------------------------------------------------------------------- 1 | function [r, dr] = corrcubic(theta, d) 2 | %CORRCUBIC Cubic correlation function, 3 | % 4 | % n 5 | % r_i = prod max(0, 1 - 3(theta_j*d_ij)^2 + 2(theta_j*d_ij)^3) , i = 1,...,m 6 | % j=1 7 | % 8 | % If length(theta) = 1, then the model is isotropic: 9 | % all theta_j = theta. 10 | % 11 | % Call: r = corrcubic(theta, d) 12 | % [r, dr] = corrcubic(theta, d) 13 | % 14 | % theta : parameters in the correlation function 15 | % d : m*n matrix with differences between given data points 16 | % r : correlation 17 | % dr : m*n matrix with the Jacobian of r at x. It is 18 | % assumed that x is given implicitly by d(i,:) = x - S(i,:), 19 | % where S(i,:) is the i'th design site. 20 | 21 | % hbn@imm.dtu.dk 22 | % Last update June 25, 2002 23 | 24 | [m n] = size(d); % number of differences and dimension of data 25 | if length(theta) == 1 26 | theta = repmat(theta,1,n); 27 | elseif length(theta) ~= n 28 | error(sprintf('Length of theta must be 1 or %d',n)) 29 | else 30 | theta = theta(:).'; 31 | end 32 | td = min(abs(d) .* repmat(theta,m,1), 1); 33 | ss = 1 - td.^2 .* (3 - 2*td); 34 | r = prod(ss, 2); 35 | 36 | if nargout > 1 37 | dr = zeros(m,n); 38 | for j = 1 : n 39 | dd = 6*theta(j) * sign(d(:,j)) .* td(:,j) .* (td(:,j) - 1); 40 | dr(:,j) = prod(ss(:,[1:j-1 j+1:n]),2) .* dd; 41 | end 42 | end -------------------------------------------------------------------------------- /ORION3_0/dace/correxp.m: -------------------------------------------------------------------------------- 1 | function [r, dr] = correxp(theta, d) 2 | %CORREXP Exponential correlation function 3 | % 4 | % n 5 | % r_i = prod exp(-theta_j * |d_ij|) 6 | % j=1 7 | % 8 | % If length(theta) = 1, then the model is isotropic: 9 | % theta_j = theta(1), j=1,...,n 10 | % 11 | % Call: r = correxp(theta, d) 12 | % [r, dr] = correxp(theta, d) 13 | % 14 | % theta : parameters in the correlation function 15 | % d : m*n matrix with differences between given data points 16 | % r : correlation 17 | % dr : m*n matrix with the Jacobian of r at x. It is 18 | % assumed that x is given implicitly by d(i,:) = x - S(i,:), 19 | % where S(i,:) is the i'th design site. 20 | 21 | % hbn@imm.dtu.dk 22 | % Last update April 12, 2002 23 | 24 | [m n] = size(d); % number of differences and dimension of data 25 | lt = length(theta); 26 | if lt == 1, theta = repmat(theta,1,n); 27 | elseif lt ~= n 28 | error(sprintf('Length of theta must be 1 or %d',n)) 29 | else 30 | theta = theta(:).'; 31 | end 32 | 33 | td = abs(d) .* repmat(-theta, m, 1); 34 | r = exp(sum(td,2)); 35 | 36 | if nargout > 1 37 | dr = repmat(-theta,m,1) .* sign(d) .* repmat(r,1,n); 38 | end -------------------------------------------------------------------------------- /ORION3_0/dace/correxpg.m: -------------------------------------------------------------------------------- 1 | function [r, dr] = correxpg(theta, d) 2 | %CORREXPG General exponential correlation function 3 | % 4 | % n 5 | % r_i = prod exp(-theta_j * d_ij^theta_n+1) 6 | % j=1 7 | % 8 | % If n > 1 and length(theta) = 2, then the model is isotropic: 9 | % theta_j = theta(1), j=1,...,n; theta_(n+1) = theta(2) 10 | % 11 | % Call: r = correxpg(theta, d) 12 | % [r, dr] = correxpg(theta, d) 13 | % 14 | % theta : parameters in the correlation function 15 | % d : m*n matrix with differences between given data points 16 | % r : correlation 17 | % dr : m*n matrix with the Jacobian of r at x. It is 18 | % assumed that x is given implicitly by d(i,:) = x - S(i,:), 19 | % where S(i,:) is the i'th design site. 20 | 21 | % hbn@imm.dtu.dk 22 | % Last update April 12, 2002 23 | 24 | [m n] = size(d); % number of differences and dimension of data 25 | lt = length(theta); 26 | if n > 1 & lt == 2 27 | theta = [repmat(theta(1),1,n) theta(2)]; 28 | elseif lt ~= n+1 29 | error(sprintf('Length of theta must be 2 or %d',n+1)) 30 | else 31 | theta = theta(:).'; 32 | end 33 | 34 | pow = theta(end); tt = repmat(-theta(1:n), m, 1); 35 | td = abs(d).^pow .* tt; 36 | r = exp(sum(td,2)); 37 | 38 | if nargout > 1 39 | dr = pow * tt .* sign(d) .* (abs(d) .^ (pow-1)) .* repmat(r,1,n); 40 | end 41 | -------------------------------------------------------------------------------- /ORION3_0/dace/corrgauss.m: -------------------------------------------------------------------------------- 1 | function [r, dr] = corrgauss(theta, d) 2 | %CORRGAUSS Gaussian correlation function, 3 | % 4 | % n 5 | % r_i = prod exp(-theta_j * d_ij^2) , i = 1,...,m 6 | % j=1 7 | % 8 | % If length(theta) = 1, then the model is isotropic: 9 | % all theta_j = theta . 10 | % 11 | % Call: r = corrgauss(theta, d) 12 | % [r, dr] = corrgauss(theta, d) 13 | % 14 | % theta : parameters in the correlation function 15 | % d : m*n matrix with differences between given data points 16 | % r : correlation 17 | % dr : m*n matrix with the Jacobian of r at x. It is 18 | % assumed that x is given implicitly by d(i,:) = x - S(i,:), 19 | % where S(i,:) is the i'th design site. 20 | 21 | % hbn@imm.dtu.dk 22 | % Last update June 2, 2002 23 | 24 | [m n] = size(d); % number of differences and dimension of data 25 | if length(theta) == 1 26 | theta = repmat(theta,1,n); 27 | elseif length(theta) ~= n 28 | error(sprintf('Length of theta must be 1 or %d',n)) 29 | end 30 | 31 | td = d.^2 .* repmat(-theta(:).',m,1); 32 | r = exp(sum(td, 2)); 33 | 34 | if nargout > 1 35 | dr = repmat(-2*theta(:).',m,1) .* d .* repmat(r,1,n); 36 | end -------------------------------------------------------------------------------- /ORION3_0/dace/corrlin.m: -------------------------------------------------------------------------------- 1 | function [r, dr] = corrlin(theta, d) 2 | %CORRLIN Linear correlation function, 3 | % 4 | % n 5 | % r_i = prod max(0, 1 - theta_j * d_ij) , i = 1,...,m 6 | % j=1 7 | % 8 | % If length(theta) = 1, then the model is isotropic: 9 | % all theta_j = theta . 10 | % 11 | % Call: r = corrlin(theta, d) 12 | % [r, dr] = corrlin(theta, d) 13 | % 14 | % theta : parameters in the correlation function 15 | % d : m*n matrix with differences between given data points 16 | % r : correlation 17 | % dr : m*n matrix with the Jacobian of r at x. It is 18 | % assumed that x is given implicitly by d(i,:) = x - S(i,:), 19 | % where S(i,:) is the i'th design site. 20 | 21 | % hbn@imm.dtu.dk 22 | % Last update April 12, 2002 23 | 24 | [m n] = size(d); % number of differences and dimension of data 25 | if length(theta) == 1 26 | theta = repmat(theta,1,n); 27 | elseif length(theta) ~= n 28 | error(sprintf('Length of theta must be 1 or %d',n)) 29 | end 30 | 31 | td = max(1 - abs(d) .* repmat(theta(:).',m,1), 0); 32 | r = prod(td, 2); 33 | 34 | if nargout > 1 35 | dr = zeros(m,n); 36 | for j = 1 : n 37 | dr(:,j) = prod(td(:,[1:j-1 j+1:n]),2) .* (-theta(j) * sign(d(:,j))); 38 | end 39 | end -------------------------------------------------------------------------------- /ORION3_0/dace/corrspherical.m: -------------------------------------------------------------------------------- 1 | function [r, dr] = corrspherical(theta, d) 2 | %CORRSPHERICAL Spherical correlation function, 3 | % 4 | % n 5 | % r_i = prod max(0, 1 - 1.5(theta_j*d_ij) + .5(theta_j*d_ij)^3) , i = 1,...,m 6 | % j=1 7 | % 8 | % If length(theta) = 1, then the model is isotropic: 9 | % all theta_j = theta . 10 | % 11 | % Call: r = corrspherical(theta, d) 12 | % [r, dr] = corrspherical(theta, d) 13 | % 14 | % theta : parameters in the correlation function 15 | % d : m*n matrix with differences between given data points 16 | % r : correlation 17 | % dr : m*n matrix with the Jacobian of r at x. It is 18 | % assumed that x is given implicitly by d(i,:) = x - S(i,:), 19 | % where S(i,:) is the i'th design site. 20 | 21 | % hbn@imm.dtu.dk 22 | % Last update April 12, 2002 23 | 24 | [m n] = size(d); % number of differences and dimension of data 25 | if length(theta) == 1 26 | theta = repmat(theta,1,n); 27 | elseif length(theta) ~= n 28 | error(sprintf('Length of theta must be 1 or %d',n)) 29 | else 30 | theta = theta(:).'; 31 | end 32 | td = min(abs(d) .* repmat(theta,m,1), 1); 33 | ss = 1 - td .* (1.5 - .5*td.^2); 34 | r = prod(ss, 2); 35 | 36 | if nargout > 1 37 | dr = zeros(m,n); 38 | for j = 1 : n 39 | dd = 1.5*theta(j) * sign(d(:,j)).*(td(:,j).^2 - 1); 40 | dr(:,j) = prod(ss(:,[1:j-1 j+1:n]),2) .* dd; 41 | end 42 | end -------------------------------------------------------------------------------- /ORION3_0/dace/dace.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/ORION3_0/dace/dace.pdf -------------------------------------------------------------------------------- /ORION3_0/dace/data1.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/ORION3_0/dace/data1.mat -------------------------------------------------------------------------------- /ORION3_0/dace/gridsamp.m: -------------------------------------------------------------------------------- 1 | function S = gridsamp(range, q) 2 | %GRIDSAMP n-dimensional grid over given range 3 | % 4 | % Call: S = gridsamp(range, q) 5 | % 6 | % range : 2*n matrix with lower and upper limits 7 | % q : n-vector, q(j) is the number of points 8 | % in the j'th direction. 9 | % If q is a scalar, then all q(j) = q 10 | % S : m*n array with points, m = prod(q) 11 | 12 | % hbn@imm.dtu.dk 13 | % Last update June 25, 2002 14 | 15 | [mr n] = size(range); dr = diff(range); 16 | if mr ~= 2 | any(dr < 0) 17 | error('range must be an array with two rows and range(1,:) <= range(2,:)') 18 | end 19 | sq = size(q); 20 | if min(sq) > 1 | any(q <= 0) 21 | error('q must be a vector with non-negative elements') 22 | end 23 | p = length(q); 24 | if p == 1, q = repmat(q,1,n); 25 | elseif p ~= n 26 | error(sprintf('length of q must be either 1 or %d',n)) 27 | end 28 | 29 | % Check for degenerate intervals 30 | i = find(dr == 0); 31 | if ~isempty(i), q(i) = 0*q(i); end 32 | 33 | % Recursive computation 34 | if n > 1 35 | A = gridsamp(range(:,2:end), q(2:end)); % Recursive call 36 | [m p] = size(A); q = q(1); 37 | S = [zeros(m*q,1) repmat(A,q,1)]; 38 | y = linspace(range(1,1),range(2,1), q); 39 | k = 1:m; 40 | for i = 1 : q 41 | S(k,1) = repmat(y(i),m,1); k = k + m; 42 | end 43 | else 44 | S = linspace(range(1,1),range(2,1), q).'; 45 | end -------------------------------------------------------------------------------- /ORION3_0/dace/lhsamp.m: -------------------------------------------------------------------------------- 1 | function S = lhsamp(m, n) 2 | %LHSAMP Latin hypercube distributed random numbers 3 | % 4 | % Call: S = lhsamp 5 | % S = lhsamp(m) 6 | % S = lhsamp(m, n) 7 | % 8 | % m : number of sample points to generate, if unspecified m = 1 9 | % n : number of dimensions, if unspecified n = m 10 | % 11 | % S : the generated n dimensional m sample points chosen from 12 | % uniform distributions on m subdivions of the interval (0.0, 1.0) 13 | 14 | % hbn@imm.dtu.dk 15 | % Last update April 12, 2002 16 | 17 | if nargin < 1, m = 1; end 18 | if nargin < 2, n = m; end 19 | 20 | S = zeros(m,n); 21 | for i = 1 : n 22 | S(:, i) = (rand(1, m) + (randperm(m) - 1))' / m; 23 | end -------------------------------------------------------------------------------- /ORION3_0/dace/regpoly0.m: -------------------------------------------------------------------------------- 1 | function [f, df] = regpoly0(S) 2 | %REGPOLY0 Zero order polynomial regression function 3 | % 4 | % Call: f = regpoly0(S) 5 | % [f, df] = regpoly0(S) 6 | % 7 | % S : m*n matrix with design sites 8 | % f : ones(m,1) 9 | % df : Jacobian at the first point (first row in S) 10 | 11 | % hbn@imm.dtu.dk 12 | % Last update April 12, 2002 13 | 14 | [m n] = size(S); 15 | f = ones(m,1); 16 | if nargout > 1 17 | df = zeros(n,1); 18 | end 19 | -------------------------------------------------------------------------------- /ORION3_0/dace/regpoly1.m: -------------------------------------------------------------------------------- 1 | function [f, df] = regpoly1(S) 2 | %REGPOLY1 First order polynomial regression function 3 | % 4 | % Call: f = regpoly1(S) 5 | % [f, df] = regpoly1(S) 6 | % 7 | % S : m*n matrix with design sites 8 | % f = [1 s] 9 | % df : Jacobian at the first point (first row in S) 10 | 11 | % hbn@imm.dtu.dk 12 | % Last update April 12, 2002 13 | 14 | [m n] = size(S); 15 | f = [ones(m,1) S]; 16 | if nargout > 1 17 | df = [zeros(n,1) eye(n)]; 18 | end -------------------------------------------------------------------------------- /ORION3_0/dace/regpoly2.m: -------------------------------------------------------------------------------- 1 | function [f, df] = regpoly2(S) 2 | %REGPOLY2 Second order polynomial regression function 3 | % Call: f = regpoly2(S) 4 | % [f, df] = regpoly2(S) 5 | % 6 | % S : m*n matrix with design sites 7 | % f = [1 S S(:,1)*S S(:,2)S(:,2:n) ... S(:,n)^2] 8 | % df : Jacobian at the first point (first row in S) 9 | 10 | % hbn@imm.dtu.dk 11 | % Last update September 4, 2002 12 | 13 | [m n] = size(S); 14 | nn = (n+1)*(n+2)/2; % Number of columns in f 15 | % Compute f 16 | f = [ones(m,1) S zeros(m,nn-n-1)]; 17 | j = n+1; q = n; 18 | for k = 1 : n 19 | f(:,j+(1:q)) = repmat(S(:,k),1,q) .* S(:,k:n); 20 | j = j+q; q = q-1; 21 | end 22 | 23 | if nargout > 1 24 | df = [zeros(n,1) eye(n) zeros(n,nn-n-1)]; 25 | j = n+1; q = n; 26 | for k = 1 : n 27 | df(k,j+(1:q)) = [2*S(1,k) S(1,k+1:n)]; 28 | for i = 1 : n-k, df(k+i,j+1+i) = S(1,k); end 29 | j = j+q; q = q-1; 30 | end 31 | end -------------------------------------------------------------------------------- /ORION3_0/default_selected_area_45.txt: -------------------------------------------------------------------------------- 1 | 5 3 3 16 13074.592 2 | 5 2 7 16 23679.23 3 | 7 2 7 64 59272.693 4 | 2 2 7 64 24585.574 5 | 7 2 9 64 82031.998 6 | 2 3 9 24 32193.529 7 | 5 3 5 32 28139.152 8 | 7 5 9 24 113813.809 9 | 5 2 5 24 17294.962 10 | 2 3 3 16 6873.779 11 | 2 7 7 64 73224.875 12 | 5 2 5 32 19737.043 13 | 5 5 5 32 45282.586 14 | 7 7 9 64 262075.363 15 | 5 7 9 24 125311.561 16 | 2 5 9 24 51674.087 17 | 2 3 3 32 8862.336 18 | 3 5 5 24 27495.644 19 | 3 3 9 16 35466.455 20 | 5 5 9 24 89911.08 21 | 2 7 5 16 27345.704 22 | 3 3 5 64 28014.084 23 | 7 5 7 64 134027.309 24 | 2 7 7 24 49693.291 25 | 3 5 9 32 71011.584 26 | 2 2 9 24 23042.603 27 | 5 5 7 16 55137.172 28 | 5 2 7 32 31038.638 29 | 7 7 7 24 112819.442 30 | 5 5 5 16 34494.491 31 | 5 3 7 32 44276.224 32 | 3 2 5 64 19955.074 33 | 7 7 7 64 188930.045 34 | 2 7 5 32 33708.982 35 | 2 3 9 16 28957.118 36 | 7 5 7 24 81091.962 37 | 7 3 9 32 80213.666 38 | 7 2 3 24 13249.757 39 | 5 2 9 16 33941.3 40 | 2 3 9 64 48093.52 41 | 7 3 9 64 115133.458 42 | 5 3 9 64 90232.657 43 | 5 5 3 16 21834.616 44 | 5 5 9 16 79112.048 45 | 7 7 5 32 82389.208 46 | 2 2 3 64 8832.172 47 | 7 7 5 16 61976.905 48 | 7 3 9 24 70371.958 49 | 2 3 3 24 7845.39 50 | 3 3 3 64 17471.891 51 | 5 5 5 24 39975.415 52 | 3 2 9 64 45233.546 53 | 2 2 3 24 5265.54 54 | 5 2 7 64 45466.218 55 | 2 7 3 64 29635.729 56 | 7 7 3 32 54790.722 57 | 3 5 9 24 64379.473 58 | 5 2 5 64 29518.6 59 | 5 2 3 24 10213.031 60 | 2 3 5 16 11882.657 61 | 2 5 7 64 52739.366 62 | 5 3 3 24 15321.575 63 | 7 5 9 16 100570.932 64 | 5 3 9 24 55585.051 65 | -------------------------------------------------------------------------------- /ORION3_0/default_selected_area_65.txt: -------------------------------------------------------------------------------- 1 | 5 5 5 24 79547.04 2 | 3 7 5 16 67860.72 3 | 2 3 3 24 15219 4 | 7 5 5 16 88073.64 5 | 7 7 9 16 286650 6 | 2 7 5 16 55388.16 7 | 5 7 7 64 284828.4 8 | 3 5 3 64 55417.68 9 | 3 3 9 16 73872.72 10 | 3 2 9 32 63460.8 11 | 3 3 5 24 34050.6 12 | 3 2 7 32 42571.44 13 | 2 5 7 16 65566.08 14 | 5 2 7 16 46652.76 15 | 7 3 7 16 85091.4 16 | 3 5 5 16 48109.32 17 | 5 7 3 64 121438.8 18 | 3 2 3 16 11639.16 19 | 3 2 3 24 13487.4 20 | 5 3 3 64 51885.72 21 | 5 3 5 64 81592.2 22 | 2 7 7 32 113325.84 23 | 3 2 5 16 20750.04 24 | 5 2 5 32 38851.56 25 | 3 2 7 16 33172.2 26 | 7 2 9 32 110138.04 27 | 3 7 9 32 202274.28 28 | 3 7 7 24 127116 29 | 7 3 9 24 143705.52 30 | 5 5 5 64 131139.36 31 | 2 3 3 32 17180.64 32 | 7 2 7 64 116619.84 33 | 5 2 7 24 53903.88 34 | 7 7 3 64 160881.84 35 | 2 2 5 24 18637.2 36 | 7 3 9 32 161960.04 37 | 5 3 9 24 115164.72 38 | 2 5 3 64 40625.64 39 | 2 7 5 32 67983.12 40 | 2 7 7 24 104083.92 41 | 3 3 5 32 38271.6 42 | 5 7 3 32 80677.08 43 | 5 7 7 24 179713.8 44 | 7 2 3 24 26280.36 45 | 5 2 7 32 60937.2 46 | 5 2 7 64 89613.72 47 | 7 7 7 32 258647.4 48 | 2 7 3 24 37180.8 49 | 3 3 9 64 126177.48 50 | 3 5 3 24 33592.68 51 | 5 2 3 16 17036.64 52 | 3 7 9 64 275787.72 53 | 5 7 5 24 109942.92 54 | 2 2 9 32 51612.84 55 | 2 5 5 24 42688.08 56 | 2 3 9 32 73358.28 57 | 3 5 5 32 60894 58 | 3 3 9 32 90923.76 59 | 5 5 3 32 57253.32 60 | 7 2 5 32 49939.92 61 | 5 5 5 32 88621.92 62 | 3 7 3 32 53890.92 63 | 5 7 9 64 404634.96 64 | 2 3 7 64 66272.76 65 | -------------------------------------------------------------------------------- /ORION3_0/int_pow.txt: -------------------------------------------------------------------------------- 1 | 6.559573 2 | 11.101109 3 | 27.525667 4 | 10.075301 5 | 39.299078 6 | 14.961228 7 | 13.039383 8 | 50.859837 9 | 8.238219 10 | 3.390809 11 | 32.224305 12 | 9.302146 13 | 20.292797 14 | 122.889034 15 | 54.777933 16 | 22.858972 17 | 4.226932 18 | 12.392389 19 | 15.797467 20 | 38.728543 21 | 12.181137 22 | 12.370802 23 | 60.687121 24 | 22.274037 25 | 30.879138 26 | 10.896300 27 | 23.812437 28 | 14.248167 29 | 50.524559 30 | 15.755845 31 | 19.746061 32 | 8.437359 33 | 86.073332 34 | 15.182044 35 | 13.210167 36 | 35.622997 37 | 36.542906 38 | 6.462751 39 | 15.876781 40 | 21.664032 41 | 54.933271 42 | -------------------------------------------------------------------------------- /ORION3_0/leak_pow.txt: -------------------------------------------------------------------------------- 1 | 0.182533 2 | 0.325329 3 | 0.778303 4 | 0.322130 5 | 1.201760 6 | 0.503095 7 | 0.374905 8 | 1.610288 9 | 0.235331 10 | 0.095593 11 | 1.134694 12 | 0.261899 13 | 0.601169 14 | 3.744284 15 | 1.756592 16 | 0.793407 17 | 0.117847 18 | 0.374532 19 | 0.528364 20 | 1.264459 21 | 0.386462 22 | 0.359650 23 | 1.856018 24 | 0.768294 25 | 1.030419 26 | 0.353762 27 | 0.775811 28 | 0.404441 29 | 1.637939 30 | 0.483576 31 | 0.577787 32 | 0.251242 33 | 2.741554 34 | 0.476431 35 | 0.450374 36 | 1.108876 37 | 1.137363 38 | 0.177352 39 | 0.504710 40 | 0.743022 41 | 1.709058 42 | -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/COPYRIGHT: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) 2000-2012 Chih-Chung Chang and Chih-Jen Lin 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions 7 | are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither name of copyright holders nor the names of its contributors 17 | may be used to endorse or promote products derived from this software 18 | without specific prior written permission. 19 | 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR 25 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 27 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 28 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 31 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/Makefile: -------------------------------------------------------------------------------- 1 | CXX ?= g++ 2 | CFLAGS = -Wall -Wconversion -O3 -fPIC 3 | SHVER = 2 4 | OS = $(shell uname) 5 | 6 | all: svm-train svm-predict svm-scale 7 | 8 | lib: svm.o 9 | if [ "$(OS)" = "Darwin" ]; then \ 10 | SHARED_LIB_FLAG="-dynamiclib -W1,-install_name,libsvm.so.$(SHVER)"; \ 11 | else \ 12 | SHARED_LIB_FLAG="-shared -W1,-soname,libsvm.so.$(SHVER)"; \ 13 | fi; \ 14 | $(CXX) $${SHARED_LIB_FLAG} svm.o -o libsvm.so.$(SHVER) 15 | 16 | svm-predict: svm-predict.c svm.o 17 | $(CXX) $(CFLAGS) svm-predict.c svm.o -o svm-predict -lm 18 | svm-train: svm-train.c svm.o 19 | $(CXX) $(CFLAGS) svm-train.c svm.o -o svm-train -lm 20 | svm-scale: svm-scale.c 21 | $(CXX) $(CFLAGS) svm-scale.c -o svm-scale 22 | svm.o: svm.cpp svm.h 23 | $(CXX) $(CFLAGS) -c svm.cpp 24 | clean: 25 | rm -f *~ svm.o svm-train svm-predict svm-scale libsvm.so.$(SHVER) 26 | -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/Makefile.win: -------------------------------------------------------------------------------- 1 | #You must ensure nmake.exe, cl.exe, link.exe are in system path. 2 | #VCVARS32.bat 3 | #Under dosbox prompt 4 | #nmake -f Makefile.win 5 | 6 | ########################################## 7 | CXX = cl.exe 8 | CFLAGS = -nologo -O2 -EHsc -I. -D __WIN32__ -D _CRT_SECURE_NO_DEPRECATE 9 | TARGET = windows 10 | 11 | all: $(TARGET)\svm-train.exe $(TARGET)\svm-predict.exe $(TARGET)\svm-scale.exe $(TARGET)\svm-toy.exe lib 12 | 13 | $(TARGET)\svm-predict.exe: svm.h svm-predict.c svm.obj 14 | $(CXX) $(CFLAGS) svm-predict.c svm.obj -Fe$(TARGET)\svm-predict.exe 15 | 16 | $(TARGET)\svm-train.exe: svm.h svm-train.c svm.obj 17 | $(CXX) $(CFLAGS) svm-train.c svm.obj -Fe$(TARGET)\svm-train.exe 18 | 19 | $(TARGET)\svm-scale.exe: svm.h svm-scale.c 20 | $(CXX) $(CFLAGS) svm-scale.c -Fe$(TARGET)\svm-scale.exe 21 | 22 | $(TARGET)\svm-toy.exe: svm.h svm.obj svm-toy\windows\svm-toy.cpp 23 | $(CXX) $(CFLAGS) svm-toy\windows\svm-toy.cpp svm.obj user32.lib gdi32.lib comdlg32.lib -Fe$(TARGET)\svm-toy.exe 24 | 25 | svm.obj: svm.cpp svm.h 26 | $(CXX) $(CFLAGS) -c svm.cpp 27 | 28 | lib: svm.cpp svm.h svm.def 29 | $(CXX) $(CFLAGS) -LD svm.cpp -Fe$(TARGET)\libsvm -link -DEF:svm.def 30 | 31 | clean: 32 | -erase /Q *.obj $(TARGET)\. 33 | 34 | -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/java/Makefile: -------------------------------------------------------------------------------- 1 | .SUFFIXES: .class .java 2 | FILES = libsvm/svm.class libsvm/svm_model.class libsvm/svm_node.class \ 3 | libsvm/svm_parameter.class libsvm/svm_problem.class \ 4 | libsvm/svm_print_interface.class \ 5 | svm_train.class svm_predict.class svm_toy.class svm_scale.class 6 | 7 | #JAVAC = jikes 8 | JAVAC_FLAGS = -target 1.5 -source 1.5 9 | JAVAC = javac 10 | # JAVAC_FLAGS = 11 | 12 | all: $(FILES) 13 | jar cvf libsvm.jar *.class libsvm/*.class 14 | 15 | .java.class: 16 | $(JAVAC) $(JAVAC_FLAGS) $< 17 | 18 | libsvm/svm.java: libsvm/svm.m4 19 | m4 libsvm/svm.m4 > libsvm/svm.java 20 | 21 | clean: 22 | rm -f libsvm/*.class *.class *.jar libsvm/*~ *~ libsvm/svm.java 23 | 24 | dist: clean all 25 | rm *.class libsvm/*.class 26 | -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/java/libsvm.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/ORION3_0/libsvm-3.12/libsvm-3.12/java/libsvm.jar -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/java/libsvm/svm_model.java: -------------------------------------------------------------------------------- 1 | // 2 | // svm_model 3 | // 4 | package libsvm; 5 | public class svm_model implements java.io.Serializable 6 | { 7 | public svm_parameter param; // parameter 8 | public int nr_class; // number of classes, = 2 in regression/one class svm 9 | public int l; // total #SV 10 | public svm_node[][] SV; // SVs (SV[l]) 11 | public double[][] sv_coef; // coefficients for SVs in decision functions (sv_coef[k-1][l]) 12 | public double[] rho; // constants in decision functions (rho[k*(k-1)/2]) 13 | public double[] probA; // pariwise probability information 14 | public double[] probB; 15 | 16 | // for classification only 17 | 18 | public int[] label; // label of each class (label[k]) 19 | public int[] nSV; // number of SVs for each class (nSV[k]) 20 | // nSV[0] + nSV[1] + ... + nSV[k-1] = l 21 | }; 22 | -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/java/libsvm/svm_node.java: -------------------------------------------------------------------------------- 1 | package libsvm; 2 | public class svm_node implements java.io.Serializable 3 | { 4 | public int index; 5 | public double value; 6 | } 7 | -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/java/libsvm/svm_parameter.java: -------------------------------------------------------------------------------- 1 | package libsvm; 2 | public class svm_parameter implements Cloneable,java.io.Serializable 3 | { 4 | /* svm_type */ 5 | public static final int C_SVC = 0; 6 | public static final int NU_SVC = 1; 7 | public static final int ONE_CLASS = 2; 8 | public static final int EPSILON_SVR = 3; 9 | public static final int NU_SVR = 4; 10 | 11 | /* kernel_type */ 12 | public static final int LINEAR = 0; 13 | public static final int POLY = 1; 14 | public static final int RBF = 2; 15 | public static final int SIGMOID = 3; 16 | public static final int PRECOMPUTED = 4; 17 | 18 | public int svm_type; 19 | public int kernel_type; 20 | public int degree; // for poly 21 | public double gamma; // for poly/rbf/sigmoid 22 | public double coef0; // for poly/sigmoid 23 | 24 | // these are for training only 25 | public double cache_size; // in MB 26 | public double eps; // stopping criteria 27 | public double C; // for C_SVC, EPSILON_SVR and NU_SVR 28 | public int nr_weight; // for C_SVC 29 | public int[] weight_label; // for C_SVC 30 | public double[] weight; // for C_SVC 31 | public double nu; // for NU_SVC, ONE_CLASS, and NU_SVR 32 | public double p; // for EPSILON_SVR 33 | public int shrinking; // use the shrinking heuristics 34 | public int probability; // do probability estimates 35 | 36 | public Object clone() 37 | { 38 | try 39 | { 40 | return super.clone(); 41 | } catch (CloneNotSupportedException e) 42 | { 43 | return null; 44 | } 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/java/libsvm/svm_print_interface.java: -------------------------------------------------------------------------------- 1 | package libsvm; 2 | public interface svm_print_interface 3 | { 4 | public void print(String s); 5 | } 6 | -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/java/libsvm/svm_problem.java: -------------------------------------------------------------------------------- 1 | package libsvm; 2 | public class svm_problem implements java.io.Serializable 3 | { 4 | public int l; 5 | public double[] y; 6 | public svm_node[][] x; 7 | } 8 | -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/java/test_applet.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/matlab/Makefile: -------------------------------------------------------------------------------- 1 | # This Makefile is used under Linux 2 | 3 | MATLABDIR ?= /usr/local/matlab 4 | # for Mac 5 | # MATLABDIR ?= /opt/local/matlab 6 | 7 | CXX ?= g++ 8 | #CXX = g++-4.1 9 | CFLAGS = -Wall -Wconversion -O3 -fPIC -I$(MATLABDIR)/extern/include -I.. 10 | 11 | MEX = $(MATLABDIR)/bin/mex 12 | MEX_OPTION = CC\#$(CXX) CXX\#$(CXX) CFLAGS\#"$(CFLAGS)" CXXFLAGS\#"$(CFLAGS)" 13 | # comment the following line if you use MATLAB on 32-bit computer 14 | MEX_OPTION += -largeArrayDims 15 | MEX_EXT = $(shell $(MATLABDIR)/bin/mexext) 16 | 17 | OCTAVEDIR ?= /usr/include/octave 18 | OCTAVE_MEX = env CC=$(CXX) mkoctfile 19 | OCTAVE_MEX_OPTION = --mex 20 | OCTAVE_MEX_EXT = mex 21 | OCTAVE_CFLAGS = -Wall -O3 -fPIC -I$(OCTAVEDIR) -I.. 22 | 23 | all: matlab 24 | 25 | matlab: binary 26 | 27 | octave: 28 | @make MEX="$(OCTAVE_MEX)" MEX_OPTION="$(OCTAVE_MEX_OPTION)" \ 29 | MEX_EXT="$(OCTAVE_MEX_EXT)" CFLAGS="$(OCTAVE_CFLAGS)" \ 30 | binary 31 | 32 | binary: svmpredict.$(MEX_EXT) svmtrain.$(MEX_EXT) libsvmread.$(MEX_EXT) libsvmwrite.$(MEX_EXT) 33 | 34 | svmpredict.$(MEX_EXT): svmpredict.c ../svm.h ../svm.o svm_model_matlab.o 35 | $(MEX) $(MEX_OPTION) svmpredict.c ../svm.o svm_model_matlab.o 36 | 37 | svmtrain.$(MEX_EXT): svmtrain.c ../svm.h ../svm.o svm_model_matlab.o 38 | $(MEX) $(MEX_OPTION) svmtrain.c ../svm.o svm_model_matlab.o 39 | 40 | libsvmread.$(MEX_EXT): libsvmread.c 41 | $(MEX) $(MEX_OPTION) libsvmread.c 42 | 43 | libsvmwrite.$(MEX_EXT): libsvmwrite.c 44 | $(MEX) $(MEX_OPTION) libsvmwrite.c 45 | 46 | svm_model_matlab.o: svm_model_matlab.c ../svm.h 47 | $(CXX) $(CFLAGS) -c svm_model_matlab.c 48 | 49 | ../svm.o: ../svm.cpp ../svm.h 50 | make -C .. svm.o 51 | 52 | clean: 53 | rm -f *~ *.o *.mex* *.obj ../svm.o 54 | -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/matlab/libsvmread.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/ORION3_0/libsvm-3.12/libsvm-3.12/matlab/libsvmread.mexw32 -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/matlab/libsvmwrite.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/ORION3_0/libsvm-3.12/libsvm-3.12/matlab/libsvmwrite.mexw32 -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/matlab/make.m: -------------------------------------------------------------------------------- 1 | % This make.m is for MATLAB and OCTAVE under Windows, Mac, and Unix 2 | 3 | try 4 | Type = ver; 5 | % This part is for OCTAVE 6 | if(strcmp(Type(1).Name, 'Octave') == 1) 7 | mex libsvmread.c 8 | mex libsvmwrite.c 9 | mex svmtrain.c ../svm.cpp svm_model_matlab.c 10 | mex svmpredict.c ../svm.cpp svm_model_matlab.c 11 | % This part is for MATLAB 12 | % Add -largeArrayDims on 64-bit machines of MATLAB 13 | else 14 | mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims libsvmread.c 15 | mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims libsvmwrite.c 16 | mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims svmtrain.c ../svm.cpp svm_model_matlab.c 17 | mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims svmpredict.c ../svm.cpp svm_model_matlab.c 18 | end 19 | catch 20 | fprintf('If make.m failes, please check README about detailed instructions.\n'); 21 | end 22 | -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/matlab/svm_model_matlab.h: -------------------------------------------------------------------------------- 1 | const char *model_to_matlab_structure(mxArray *plhs[], int num_of_feature, struct svm_model *model); 2 | struct svm_model *matlab_matrix_to_model(const mxArray *matlab_struct, const char **error_message); 3 | -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/matlab/svmpredict.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/ORION3_0/libsvm-3.12/libsvm-3.12/matlab/svmpredict.mexw32 -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/matlab/svmtrain.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/ORION3_0/libsvm-3.12/libsvm-3.12/matlab/svmtrain.mexw32 -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/python/Makefile: -------------------------------------------------------------------------------- 1 | all = lib 2 | 3 | lib: 4 | make -C .. lib 5 | -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/svm-toy/gtk/Makefile: -------------------------------------------------------------------------------- 1 | CC? = gcc 2 | CXX? = g++ 3 | CFLAGS = -Wall -O3 -g `pkg-config --cflags gtk+-2.0` 4 | LIBS = `pkg-config --libs gtk+-2.0` 5 | 6 | svm-toy: main.o interface.o callbacks.o ../../svm.o 7 | $(CXX) $(CFLAGS) main.o interface.o callbacks.o ../../svm.o -o svm-toy $(LIBS) 8 | 9 | main.o: main.c 10 | $(CC) $(CFLAGS) -c main.c 11 | 12 | interface.o: interface.c interface.h 13 | $(CC) $(CFLAGS) -c interface.c 14 | 15 | callbacks.o: callbacks.cpp callbacks.h 16 | $(CXX) $(CFLAGS) -c callbacks.cpp 17 | 18 | ../../svm.o: ../../svm.cpp ../../svm.h 19 | make -C ../.. svm.o 20 | 21 | clean: 22 | rm -f *~ callbacks.o svm-toy main.o interface.o callbacks.o ../../svm.o 23 | -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/svm-toy/gtk/callbacks.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | void 8 | on_window1_destroy (GtkObject *object, 9 | gpointer user_data); 10 | 11 | gboolean 12 | on_draw_main_button_press_event (GtkWidget *widget, 13 | GdkEventButton *event, 14 | gpointer user_data); 15 | 16 | gboolean 17 | on_draw_main_expose_event (GtkWidget *widget, 18 | GdkEventExpose *event, 19 | gpointer user_data); 20 | 21 | void 22 | on_button_change_clicked (GtkButton *button, 23 | gpointer user_data); 24 | 25 | void 26 | on_button_run_clicked (GtkButton *button, 27 | gpointer user_data); 28 | 29 | void 30 | on_button_clear_clicked (GtkButton *button, 31 | gpointer user_data); 32 | 33 | void 34 | on_button_save_clicked (GtkButton *button, 35 | gpointer user_data); 36 | 37 | void 38 | on_button_load_clicked (GtkButton *button, 39 | gpointer user_data); 40 | 41 | void 42 | on_fileselection_destroy (GtkObject *object, 43 | gpointer user_data); 44 | 45 | void 46 | on_filesel_ok_clicked (GtkButton *button, 47 | gpointer user_data); 48 | 49 | void 50 | on_filesel_cancel_clicked (GtkButton *button, 51 | gpointer user_data); 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/svm-toy/gtk/interface.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT EDIT THIS FILE - it is generated by Glade. 3 | */ 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | GtkWidget* create_window (void); 10 | GtkWidget* create_fileselection (void); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/svm-toy/gtk/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Initial main.c file generated by Glade. Edit as required. 3 | * Glade will not overwrite this file. 4 | */ 5 | 6 | #include 7 | #include "interface.h" 8 | void svm_toy_initialize(); 9 | 10 | int main (int argc, char *argv[]) 11 | { 12 | GtkWidget *window; 13 | 14 | gtk_set_locale (); 15 | gtk_init (&argc, &argv); 16 | 17 | window = create_window (); 18 | gtk_widget_show (window); 19 | 20 | svm_toy_initialize(); 21 | gtk_main (); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/svm-toy/qt/Makefile: -------------------------------------------------------------------------------- 1 | CXX? = g++ 2 | CFLAGS = -Wall -O3 -I$(INCLUDE) -I$(INCLUDE)/QtGui -lQtGui 3 | INCLUDE = /usr/include/qt4 4 | MOC = /usr/bin/moc-qt4 5 | 6 | svm-toy: svm-toy.cpp svm-toy.moc ../../svm.o 7 | $(CXX) $(CFLAGS) svm-toy.cpp ../../svm.o -o svm-toy 8 | 9 | svm-toy.moc: svm-toy.cpp 10 | $(MOC) svm-toy.cpp -o svm-toy.moc 11 | 12 | ../../svm.o: ../../svm.cpp ../../svm.h 13 | make -C ../.. svm.o 14 | 15 | clean: 16 | rm -f *~ svm-toy svm-toy.moc ../../svm.o 17 | 18 | -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/svm.def: -------------------------------------------------------------------------------- 1 | LIBRARY libsvm 2 | EXPORTS 3 | svm_train @1 4 | svm_cross_validation @2 5 | svm_save_model @3 6 | svm_load_model @4 7 | svm_get_svm_type @5 8 | svm_get_nr_class @6 9 | svm_get_labels @7 10 | svm_get_svr_probability @8 11 | svm_predict_values @9 12 | svm_predict @10 13 | svm_predict_probability @11 14 | svm_free_model_content @12 15 | svm_free_and_destroy_model @13 16 | svm_destroy_param @14 17 | svm_check_parameter @15 18 | svm_check_probability_model @16 19 | svm_set_print_string_function @17 20 | -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/windows/libsvm.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/ORION3_0/libsvm-3.12/libsvm-3.12/windows/libsvm.dll -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/windows/libsvmread.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/ORION3_0/libsvm-3.12/libsvm-3.12/windows/libsvmread.mexw32 -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/windows/libsvmread.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/ORION3_0/libsvm-3.12/libsvm-3.12/windows/libsvmread.mexw64 -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/windows/libsvmwrite.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/ORION3_0/libsvm-3.12/libsvm-3.12/windows/libsvmwrite.mexw32 -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/windows/libsvmwrite.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/ORION3_0/libsvm-3.12/libsvm-3.12/windows/libsvmwrite.mexw64 -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/windows/make.m: -------------------------------------------------------------------------------- 1 | % This make.m is for MATLAB and OCTAVE under Windows, Mac, and Unix 2 | 3 | try 4 | Type = ver; 5 | % This part is for OCTAVE 6 | if(strcmp(Type(1).Name, 'Octave') == 1) 7 | mex libsvmread.c 8 | mex libsvmwrite.c 9 | mex svmtrain.c ../svm.cpp svm_model_matlab.c 10 | mex svmpredict.c ../svm.cpp svm_model_matlab.c 11 | % This part is for MATLAB 12 | % Add -largeArrayDims on 64-bit machines of MATLAB 13 | else 14 | mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims libsvmread.c 15 | mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims libsvmwrite.c 16 | mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims svmtrain.c ../svm.cpp svm_model_matlab.c 17 | mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims svmpredict.c ../svm.cpp svm_model_matlab.c 18 | end 19 | catch 20 | fprintf('If make.m failes, please check README about detailed instructions.\n'); 21 | end 22 | -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/windows/svm-predict.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/ORION3_0/libsvm-3.12/libsvm-3.12/windows/svm-predict.exe -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/windows/svm-scale.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/ORION3_0/libsvm-3.12/libsvm-3.12/windows/svm-scale.exe -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/windows/svm-toy.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/ORION3_0/libsvm-3.12/libsvm-3.12/windows/svm-toy.exe -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/windows/svm-train.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/ORION3_0/libsvm-3.12/libsvm-3.12/windows/svm-train.exe -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/windows/svmpredict.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/ORION3_0/libsvm-3.12/libsvm-3.12/windows/svmpredict.mexw32 -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/windows/svmpredict.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/ORION3_0/libsvm-3.12/libsvm-3.12/windows/svmpredict.mexw64 -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/windows/svmtrain.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/ORION3_0/libsvm-3.12/libsvm-3.12/windows/svmtrain.mexw32 -------------------------------------------------------------------------------- /ORION3_0/libsvm-3.12/libsvm-3.12/windows/svmtrain.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/ORION3_0/libsvm-3.12/libsvm-3.12/windows/svmtrain.mexw64 -------------------------------------------------------------------------------- /ORION3_0/makeInfo.txt: -------------------------------------------------------------------------------- 1 | make[1]: Entering directory '/home/csy/CoMN/CoMN/ORION3_0' 2 | make[1]: 'orion_router' is up to date. 3 | make[1]: Leaving directory '/home/csy/CoMN/CoMN/ORION3_0' 4 | -------------------------------------------------------------------------------- /ORION3_0/online_users: -------------------------------------------------------------------------------- 1 | iccad2023.41363f84-3518-11ee-bf76-a3d6b4c64283.1691452078463 2 | iccad2023.a2b182ee-351a-11ee-aec3-bda5fcd3b61f.1691453101003 3 | iccad2023.da2396f4-351a-11ee-aec3-bda5fcd3b61f.1691453194025 4 | -------------------------------------------------------------------------------- /ORION3_0/output.txt: -------------------------------------------------------------------------------- 1 | No information provided. Running Orion 3.0 basic mode 2 | INSTSinbuffer: 4805 3 | INSTSoutbuffer: 1725 4 | INSTScrossbar: 400 5 | INSTSswvc: 3960 6 | INSTSclkctrl: 209 7 | Pleakage: 0.304553 8 | Pinternal: 7.59707 9 | Pswitching: 5.53232 10 | Ptotal: 13.4339 11 | INSTSinbuffer: 4805 12 | INSTSoutbuffer: 1725 13 | INSTScrossbar: 400 14 | INSTSswvc: 3960 15 | INSTSclkctrl: 209 16 | Ainbuffer: 22487.4 17 | Aoutbuffer: 8073 18 | Acrossbar: 1440 19 | Aswvc: 7761.6 20 | Aclkctrl: 376.2 21 | Atotal: 40138.2 22 | -------------------------------------------------------------------------------- /ORION3_0/params.txt: -------------------------------------------------------------------------------- 1 | 65 2 | 5 3 3 16 3 | 5 2 7 16 4 | 7 2 7 64 5 | 2 2 7 64 6 | 7 2 9 64 7 | 2 3 9 24 8 | 5 3 5 32 9 | 7 5 9 24 10 | 5 2 5 24 11 | 2 3 3 16 12 | 2 7 7 64 13 | 5 2 5 32 14 | 5 5 5 32 15 | 7 7 9 64 16 | 5 7 9 24 17 | 2 5 9 24 18 | 2 3 3 32 19 | 3 5 5 24 20 | 3 3 9 16 21 | 5 5 9 24 22 | 2 7 5 16 23 | 3 3 5 64 24 | 7 5 7 64 25 | 2 7 7 24 26 | 3 5 9 32 27 | 2 2 9 24 28 | 5 5 7 16 29 | 5 2 7 32 30 | 7 7 7 24 31 | 5 5 5 16 32 | 5 3 7 32 33 | 3 2 5 64 34 | 7 7 7 64 35 | 2 7 5 32 36 | 2 3 9 16 37 | 7 5 7 24 38 | 7 3 9 32 39 | 7 2 3 24 40 | 5 2 9 16 41 | 2 3 9 64 42 | 7 3 9 64 43 | -------------------------------------------------------------------------------- /ORION3_0/print_params.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -f 2 | NEWPATH=$1 3 | if [ -e params.txt ] 4 | then 5 | rm params.txt 6 | fi 7 | 8 | if [ $NEWPATH = "default" ] 9 | then 10 | 11 | TECH=`grep "PARM_TECH_POINT" SIM_port.h | awk '{print $3}' ` 12 | B=`grep "PARM_in_buf_set" SIM_port.h | awk '{print $3}' ` 13 | V=`grep "PARM_v_channel" SIM_port.h | awk '{print $3}' ` 14 | P=`grep "PARM_in_port" SIM_port.h | awk '{print $3}' ` 15 | F=`grep "PARM_flit_width" SIM_port.h | awk '{print $3}' ` 16 | 17 | 18 | echo $TECH >> params.txt 19 | echo $B $V $P $F >> params.txt 20 | 21 | else 22 | 23 | TECH=`grep "PARM_TECH_POINT" SIM_port.h | awk '{print $3}' ` 24 | echo $TECH >> params.txt 25 | cat $NEWPATH >> params.txt 26 | 27 | fi -------------------------------------------------------------------------------- /ORION3_0/rbf2/INSTALL.txt: -------------------------------------------------------------------------------- 1 | 2 | Matlab Functions for Radial Basis Function Networks 3 | --------------------------------------------------- 4 | 5 | Installation Instructions. 6 | 7 | 1. Unpack the distribution in some convenient folder. 8 | 9 | 2. Within this folder you will find a number of 10 | subdirectories, including meth, util and demo. 11 | Add these three to your Matlab path. 12 | 13 | 3. Further information is available in the manual, 14 | a PostScript document called manual.ps, which can 15 | be found in the man folder. 16 | 17 | Notes 18 | 19 | * There's a Perl script called mstats.pl in the perl 20 | folder which will be of use if you have the DELVE 21 | software (www.cs.toronto.edu/~delve). It may need 22 | tayloring to your local system. 23 | 24 | * If you need a PostScript viewer for the manual you 25 | can get one free at www.cs.wisc.edu/~ghost. 26 | 27 | * The latest release notes are in NOTES.txt. 28 | 29 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/NOTES.txt: -------------------------------------------------------------------------------- 1 | Version 2.2 June 30 1999 2 | 3 | Added conf.maxse field to plot_ras utility. 4 | 5 | Added info.gam (effective number of parameters) field for 6 | rbf_fs_2 and rbf_rr_2 methods. 7 | 8 | Some typos fixed in manual. 9 | 10 | Version 2.1 June 15 1999 11 | 12 | Fixed some bugs in meth/rbf_fs_2.m. Could cause divide by zero 13 | if any centres were duplicated. 14 | 15 | Changed incorrect URL given in util/rbf_ver.m. 16 | 17 | Added man/examples/ to rbf2.tar.gz distribution. In version 2.0 18 | this folder had been accidently omitted. 19 | 20 | Fixed problem with left/right page numbering in manual and 21 | correctly labelled the axis in figure 3 for rbf_dm. 22 | 23 | Version 2.0 June 11 1999 24 | 25 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/delve-1.1p3.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/ORION3_0/rbf2/delve-1.1p3.tar.gz -------------------------------------------------------------------------------- /ORION3_0/rbf2/delve-1.1p3/delve-1.1p3/copyright: -------------------------------------------------------------------------------- 1 | Copyright (c) 1995-1996 by The University of Toronto, 2 | Toronto, Ontario, Canada. 3 | 4 | All Rights Reserved 5 | 6 | Permission to use, copy, modify, and distribute this software and its 7 | documentation for NON-COMMERCIAL PURPOSES ONLY is hereby granted 8 | without fee, provided that the above copyright notice appears in all 9 | copies and that both the copyright notice and this permission notice 10 | appear in supporting documentation, and that the name of The 11 | University of Toronto not be used in advertising or publicity 12 | pertaining to distribution of the software without specific, written 13 | prior permission. The University of Toronto makes no representations 14 | about the suitability of this software for any purpose. It is 15 | provided "as is" without express or implied warranty. 16 | 17 | THE UNIVERSITY OF TORONTO DISCLAIMS ALL WARRANTIES WITH REGARD TO 18 | THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 19 | AND FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF TORONTO BE LIABLE 20 | FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 21 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 22 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT 23 | OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 24 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/delve-1.1p3/delve-1.1p3/delve.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * delve.h - Header file containing declarations shared within the 4 | * DELVE source code. 5 | * 6 | * Copyright (c) 1996 by The University of Toronto. 7 | * 8 | * See the file "copyright" for information on usage and redistribution 9 | * of this file, and for a DISCLAIMER OF ALL WARRANTIES. 10 | * 11 | * Author: Delve (delve@cs.toronto.edu) 12 | * 13 | * $Id: delve.h,v 1.7.2.4.2.2 1997/11/27 16:42:56 revow Exp $ 14 | */ 15 | 16 | #ifndef DELVE_H 17 | #define DELVE_H 18 | 19 | #include 20 | #include 21 | 22 | #ifdef STDC_HEADERS 23 | #include 24 | #endif 25 | 26 | #define DELVE_VERSION "1.1" 27 | #define DELVE_MAJOR_VERSION 1 28 | #define DELVE_MINOR_VERSION 1 29 | 30 | typedef CONST struct matrix_t { 31 | double ** x ; 32 | int rows ; 33 | int cols ; 34 | } matrix_t ; 35 | 36 | EXTERN int Delve_GetMatrix _ANSI_ARGS_((Tcl_Interp *interp, 37 | CONST char *handle, matrix_t **matrixPtrPtr)); 38 | EXTERN int Delve_InitAnova _ANSI_ARGS_((Tcl_Interp *interp)) ; 39 | EXTERN int Delve_InitAttr _ANSI_ARGS_((Tcl_Interp *interp)) ; 40 | EXTERN int Delve_InitMatrix _ANSI_ARGS_((Tcl_Interp *interp)) ; 41 | EXTERN int Delve_InitRandom _ANSI_ARGS_((Tcl_Interp *interp)) ; 42 | EXTERN int Delve_RandomNumber _ANSI_ARGS_((Tcl_Interp *interp, 43 | double * doublePtr)) ; 44 | EXTERN int Delve_RandomSeed _ANSI_ARGS_((Tcl_Interp *interp, 45 | long int seed)) ; 46 | EXTERN int MatrixStatsCmd _ANSI_ARGS_((ClientData dummy, 47 | Tcl_Interp * interp, int argc, char **argv)); 48 | 49 | #endif /* DELVE_H */ 50 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/delve-1.1p3/delve-1.1p3/doc/mystyle.sty: -------------------------------------------------------------------------------- 1 | % 2 | % $Id: mystyle.sty,v 1.13 1996/04/07 01:30:24 radford Exp $ 3 | % 4 | 5 | % 6 | % We redefine the caption to be smaller in font size. 7 | % 8 | 9 | \NeedsTeXFormat{LaTeX2e} 10 | \ProvidesPackage{mystyle} 11 | \RequirePackage{ifthen} 12 | 13 | \newbox{\tempbox} 14 | \newcommand{\@mycaption}[2]{% #1 is e.t. Figure 1, #2 is caption text 15 | \vspace{10pt}\sbox{\tempbox}{\small #1: #2}% 16 | \ifthenelse{\lengthtest{\wd\tempbox > \linewidth}}% 17 | {\small #1: #2\par}% More than one line 18 | {\begin{center}\small #1: #2\end{center}}% 19 | } 20 | 21 | \renewcommand{\@makecaption}{\@mycaption} 22 | 23 | \renewcommand{\thefigure}{\thesection.\@arabic\c@figure} 24 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/delve-1.1p3/delve-1.1p3/library/matrix.tcl: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- 2 | # $Id: matrix.tcl,v 1.5.2.5 1996/11/12 16:55:41 revow Exp $ 3 | # 4 | # File containing procedures dealing with matrices. 5 | # 6 | # AUTHOR HISTORY: 7 | # Author Delve (delve@cs.toronto.edu) 8 | # Drew van Camp (drew@cs.toronto.edu) 9 | # 10 | # Copyright (c) 1995-1996 The University of Toronto. 11 | # 12 | # See the file "copyright" for information on usage and redistribution 13 | # of this file, and for a DISCLAIMER OF ALL WARRANTIES. 14 | # 15 | # ---------------------------------------------------------------------- 16 | 17 | # ---------------------------------------------------------------------- 18 | # pmatrix - prints a matrix out to an open file descriptor 19 | # 20 | # The procedure prints out the matrix one row to a line to an open 21 | # file descriptor (by default "stdout"). 22 | # ---------------------------------------------------------------------- 23 | 24 | proc pmatrix { matrix { fileId stdout } } { 25 | set list [d_matrix size $matrix] ; 26 | set rows [lindex $list 0] 27 | set cols [lindex $list 1] 28 | for { set row 0 } { $row < $rows } { incr row } { 29 | set line {} ; 30 | for { set col 0 } { $col < $cols } { incr col } { 31 | lappend line [d_matrix entryset $matrix $row $col] ; 32 | } 33 | puts $fileId $line 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/delve-1.1p3/delve-1.1p3/library/randList.tcl: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- 2 | # $Id: randList.tcl,v 1.2.2.4 1996/11/12 16:55:42 revow Exp $ 3 | # 4 | # This procedure prints the numbers one through to an open file id 5 | # (default stdout), in random order. 6 | # 7 | # It first builds an ordered array of the numbers (keyed by the 8 | # numbers themselves). It then iterates over the array swapping each 9 | # element with a random element at that position or later. This 10 | # has the effect of randomly shuffling the numbers, with each permutation 11 | # having equal probability. 12 | # 13 | # The suffled array is then printed out. 14 | # 15 | # AUTHOR HISTORY: 16 | # Author Delve (delve@cs.toronto.edu) 17 | # Drew van Camp (drew@cs.toronto.edu) 18 | # 19 | # Copyright (c) 1995-1996 The University of Toronto. 20 | # 21 | # See the file "copyright" for information on usage and redistribution 22 | # of this file, and for a DISCLAIMER OF ALL WARRANTIES. 23 | # 24 | # ---------------------------------------------------------------------- 25 | 26 | proc d_randList { n { fileId stdout } } { 27 | for { set idx 0 } { $idx < $n } { incr idx } { 28 | set num($idx) [expr {$idx + 1}] ; 29 | } 30 | 31 | for { set oldIdx 0 } { $oldIdx < $n } { incr oldIdx } { 32 | set rand_offset [d_random [expr {$n - $oldIdx}]] 33 | set newIdx [expr {$oldIdx + $rand_offset}] 34 | set tmp $num($newIdx) ; 35 | set num($newIdx) $num($oldIdx) ; 36 | set num($oldIdx) $tmp ; 37 | } 38 | 39 | for { set idx 0 } { $idx < $n } { incr idx } { 40 | puts $fileId $num($idx) ; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/delve-1.1p3/delve-1.1p3/mkdirhier-sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $XConsortium: mkdirhier.sh,v 1.7 94/03/24 15:46:34 gildea Exp $ 3 | # Courtesy of Paul Eggert 4 | 5 | newline=' 6 | ' 7 | IFS=$newline 8 | 9 | case ${1--} in 10 | -*) echo >&2 "mkdirhier: usage: mkdirhier directory ..."; exit 1 11 | esac 12 | 13 | status= 14 | 15 | for directory 16 | do 17 | case $directory in 18 | '') 19 | echo >&2 "mkdirhier: empty directory name" 20 | status=1 21 | continue;; 22 | *"$newline"*) 23 | echo >&2 "mkdirhier: directory name contains a newline: \`\`$directory''" 24 | status=1 25 | continue;; 26 | ///*) prefix=/;; # See Posix 2.3 "path". 27 | //*) prefix=//;; 28 | /*) prefix=/;; 29 | -*) prefix=./;; 30 | *) prefix= 31 | esac 32 | 33 | IFS=/ 34 | set x $directory 35 | case $2 in 36 | */*) # IFS parsing is broken 37 | IFS=' ' 38 | set x `echo $directory | tr / ' '` 39 | ;; 40 | esac 41 | IFS=$newline 42 | shift 43 | 44 | for filename 45 | do 46 | path=$prefix$filename 47 | prefix=$path/ 48 | shift 49 | 50 | test -d "$path" || { 51 | paths=$path 52 | for filename 53 | do 54 | if [ "$filename" != "." ]; then 55 | path=$path/$filename 56 | paths=$paths$newline$path 57 | fi 58 | done 59 | 60 | mkdir $paths || status=$? 61 | 62 | break 63 | } 64 | done 65 | done 66 | 67 | exit $status 68 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/delve-1.1p3/delve-1.1p3/patchlevel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * patchlevel.h - This file does nothing except define a "patch 3 | * level" for Delve. The patch level has the form "X.YpZ" where X.Y 4 | * is the base release, and Z is a serial number that is used to 5 | * sequence patches for a given release. Thus 7.4p1 is the first 6 | * patch to release 7.4, 7.4p2 is the patch that follows 7.4p1, and 7 | * so on. The "pZ" is omitted in an original new release, and it is 8 | * replaced with "bZ" for beta releases and "aZ" for alpha releases. 9 | * The patch level ensures that patches are applied in the correct 10 | * order and only to appropriate sources. 11 | * 12 | * Copyright (c) 1996 by The University of Toronto. 13 | * 14 | * See the file "copyright" for information on usage and redistribution 15 | * of this file, and for a DISCLAIMER OF ALL WARRANTIES. 16 | * 17 | * Author: Delve (delve@cs.toronto.edu) 18 | * 19 | * $Id: patchlevel.h,v 1.2.2.4.2.3 1997/11/27 16:42:57 revow Exp $ */ 20 | 21 | #define DELVE_PATCH_LEVEL "1.1p3" 22 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/delve-1.1p3/delve-1.1p3/tests/all: -------------------------------------------------------------------------------- 1 | # This file contains a top-level script to run all of the Delve tests. 2 | # Execute it by invoking "source all" when running delvesh in this 3 | # directory. 4 | # 5 | # $Id: all,v 1.1 1996/04/12 18:43:44 drew Exp $ 6 | 7 | foreach i [lsort [glob *.test]] { 8 | puts stdout $i 9 | source $i 10 | } 11 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/delve-1.1p3/delve-1.1p3/tests/copyright: -------------------------------------------------------------------------------- 1 | Copyright (c) 1995-1996 by The University of Toronto, 2 | Toronto, Ontario, Canada. 3 | 4 | All Rights Reserved 5 | 6 | Permission to use, copy, modify, and distribute this software and its 7 | documentation for NON-COMMERCIAL PURPOSES ONLY is hereby granted 8 | without fee, provided that the above copyright notice appears in all 9 | copies and that both the copyright notice and this permission notice 10 | appear in supporting documentation, and that the name of The 11 | University of Toronto not be used in advertising or publicity 12 | pertaining to distribution of the software without specific, written 13 | prior permission. The University of Toronto makes no representations 14 | about the suitability of this software for any purpose. It is 15 | provided "as is" without express or implied warranty. 16 | 17 | THE UNIVERSITY OF TORONTO DISCLAIMS ALL WARRANTIES WITH REGARD TO 18 | THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 19 | AND FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF TORONTO BE LIABLE 20 | FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 21 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 22 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT 23 | OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 24 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/delve-1.1p3/delve-1.1p3/todo: -------------------------------------------------------------------------------- 1 | $Id: todo,v 1.25.2.9 1996/06/13 17:12:30 drew Exp $ 2 | 3 | Sorted by priority 4 | 5 | For version 1.0 6 | =============== 7 | 8 | - nothing 9 | 10 | For version 1.1 11 | =============== 12 | 13 | - Modify "mstats" so that it can generate "loss" files from "cguess" etc, 14 | on the fly, without having the "Test-set-stats" files 15 | explicitly around. (Difficult) 16 | 17 | - Write the "mtable" and "mcheck" scripts. (Difficult) 18 | 19 | - In the dataset specification files the "missing value indicator" "?" 20 | should be allowed. (Moderate to difficult). 21 | 22 | - Implement censored values. (Difficult) 23 | 24 | - Implement attribute '0', the index of the case (Moderate). 25 | 26 | - Implement sequential prototasks and stratification. (Moderate) 27 | 28 | - Implement commonality indices. (Difficult) 29 | 30 | - Implement non-standard task instances. (Moderate) 31 | 32 | - Allow invertible operations (like log(x), exp(x) and 33 | squeeze(x)=sign(x)*log(1+|x|)) on attributes in the 34 | Prototask.spec files. (Difficult) 35 | 36 | - make 'loss.Z' files contain '0' or '1', not '0.0 and '1.0'. This is 37 | probably not important; in the case where more than on target attribute 38 | is to be predicted the average (or will it be sum?) loss may not be 39 | integer. (Easy, but is this really desirable?) 40 | 41 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/delve-1.1p3/delve-1.1p3/utils/copyright: -------------------------------------------------------------------------------- 1 | Copyright (c) 1995-1996 by The University of Toronto, 2 | Toronto, Ontario, Canada. 3 | 4 | All Rights Reserved 5 | 6 | Permission to use, copy, modify, and distribute this software and its 7 | documentation for NON-COMMERCIAL PURPOSES ONLY is hereby granted 8 | without fee, provided that the above copyright notice appears in all 9 | copies and that both the copyright notice and this permission notice 10 | appear in supporting documentation, and that the name of The 11 | University of Toronto not be used in advertising or publicity 12 | pertaining to distribution of the software without specific, written 13 | prior permission. The University of Toronto makes no representations 14 | about the suitability of this software for any purpose. It is 15 | provided "as is" without express or implied warranty. 16 | 17 | THE UNIVERSITY OF TORONTO DISCLAIMS ALL WARRANTIES WITH REGARD TO 18 | THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 19 | AND FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF TORONTO BE LIABLE 20 | FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 21 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 22 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT 23 | OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 24 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/demo/Contents.m: -------------------------------------------------------------------------------- 1 | % Functions that define demos of various routines that are run by 2 | % run_demo or turned into scripts (to be modified or otherwise 3 | % played around with) by dump_demo (planned but not yet written). 4 | % 5 | % demo_get_data - Demo of RBF design matrix utility. 6 | % demo_rbf_fs_2 - Demo of regularised forward selection of RBFs. 7 | % demo_rbf_rr_2 - Demo of ridge regression with RBFs. 8 | % demo_rbf_rt_1 - Demo of hybrid RBF and regression tree method. 9 | % demo_rbf_rt_2 - Demo of hybrid RBF and regression tree method. 10 | % 11 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/man/examples/get_data/fig1.m: -------------------------------------------------------------------------------- 1 | % Figure 1 in the get_data manual page. 2 | clear 3 | 4 | % Sine1 training data. 5 | [x, y, conf] = get_data('sine1'); 6 | 7 | % Display some of the default parameters. 8 | fprintf('conf.p = %d\n', conf.p) 9 | fprintf('conf.x1, x2 = %.1f, %.1f\n', conf.x1, conf.x2) 10 | fprintf('conf.par = '), fprintf('%.1f ', conf.par), fprintf('\n') 11 | fprintf('conf.std = %.1f\n', conf.std) 12 | 13 | % Test data (unordered). 14 | conf.p = 200; 15 | conf.std = 0; 16 | [xt1, yt1] = get_data(conf); 17 | 18 | % Test data (ordered). 19 | conf.ord = 1; 20 | [xt2, yt2] = get_data(conf); 21 | 22 | % Get figure. 23 | fig = get_fig('Figure 1'); 24 | 25 | % Plot. 26 | hold off 27 | plot(x, y, 'r*', 'MarkerSize', 10) 28 | hold on 29 | plot(xt1, yt1, 'b+', 'MarkerSize', 10) 30 | plot(xt2, yt2, 'g-', 'LineWidth', 2) 31 | 32 | % Configure plot. 33 | set(gca, 'FontSize', 16) 34 | set(gca, 'Position', [0.1 0.15 0.85 0.8]) 35 | set(gca, 'XLim', [-1 1]) 36 | set(gca, 'YLim', [-1 1]) 37 | set(gca, 'XTick', [-1 1]) 38 | set(gca, 'YTick', [-1 1]) 39 | xlabel('x', 'FontSize', 16) 40 | ylabel('y', 'FontSize', 16, 'Rotation', 0) 41 | legend('training set', 'test (unordered)', 'test (ordered)', 3) 42 | 43 | % Save postscript. 44 | print -depsc fig1 45 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/man/examples/get_data/fig2.m: -------------------------------------------------------------------------------- 1 | % Figure 2 in the get_data manual page. 2 | clear 3 | 4 | % Sine2 training data. 5 | [X, y, conf] = get_data('sine2'); 6 | 7 | % Test data. 8 | conf.ord = 400; 9 | conf.std = 0; 10 | conf.ord = 1; 11 | [Xt, yt, conf] = get_data(conf); 12 | 13 | % Stuff needed for a mesh plot. 14 | q = sqrt(conf.p); 15 | x1 = linspace(conf.x1(1), conf.x2(1), q); 16 | x2 = linspace(conf.x1(2), conf.x2(2), q); 17 | Yt = zeros(q,q); Yt(:) = yt; 18 | 19 | % Get figure. 20 | fig = get_fig('Figure 2'); 21 | 22 | % Plot. 23 | hold off 24 | plot3(X(1,:), X(2,:), y, 'ko', 'MarkerSize', 10) 25 | hold on 26 | mesh(x1, x2, Yt) 27 | 28 | % Configure plot. 29 | grid on 30 | set(gca, 'FontSize', 16) 31 | set(gca, 'Position', [0.15 0.20 0.75 0.75]) 32 | set(gca, 'XLim', [conf.x1(1) conf.x2(1)]) 33 | set(gca, 'YLim', [conf.x1(2) conf.x2(2)]) 34 | set(gca, 'ZLim', [-1 1]) 35 | set(gca, 'XTick', conf.x1(1):5:conf.x2(1)) 36 | set(gca, 'YTick', conf.x1(2):5:conf.x2(2)) 37 | set(gca, 'ZTick', [-1 0 1]) 38 | xlabel('x_1', 'FontSize', 16) 39 | ylabel('x_2', 'FontSize', 16) 40 | zlabel('y', 'FontSize', 16) 41 | 42 | % Save postscript. 43 | print -depsc fig2 44 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/man/examples/get_tmr/fig1.m: -------------------------------------------------------------------------------- 1 | % Figure 1 in the get_timer manual page. 2 | clear 3 | 4 | % Get a timer. 5 | tmr = get_tmr(struct('name', 'demo', 'n', 100)); 6 | 7 | % Increment it a few times. 8 | for i = 1:42 9 | inc_tmr(tmr) 10 | end 11 | 12 | % Now use separate software to capture 13 | % an image of the timer window. -------------------------------------------------------------------------------- /ORION3_0/rbf2/man/examples/grow_tree/fig12.m: -------------------------------------------------------------------------------- 1 | % Figures 1 and 2 in the grow_tree manual page. 2 | clear 3 | 4 | % Sine2 training data. 5 | [X, y] = get_data('sine2'); 6 | 7 | % Test data. 8 | test.name = 'sine2'; 9 | test.p = 400; 10 | test.std = 0; 11 | test.ord = 1; 12 | [Xt, yt, test] = get_data(test); 13 | 14 | % Run the method. 15 | tree = grow_tree(X, y, conf); 16 | 17 | % Predict the test set. 18 | ft = pred_tree(tree, Xt); 19 | 20 | % Stuff needed for a mesh plot. 21 | q = sqrt(test.p); 22 | x1 = linspace(test.x1(1), test.x2(1), q); 23 | x2 = linspace(test.x1(2), test.x2(2), q); 24 | Yt = zeros(q,q); Yt(:) = yt; 25 | Ft = zeros(q,q); Ft(:) = ft; 26 | 27 | % Get figures. 28 | fig1 = get_fig('Figure 1'); 29 | fig2 = get_fig('Figure 2'); 30 | 31 | % Plot. 32 | figure(fig1) 33 | hold off 34 | mesh(x1, x2, Yt) 35 | figure(fig2) 36 | hold off 37 | mesh(x1, x2, Ft) 38 | 39 | % Configure both plots. 40 | figure(fig1) 41 | grid on 42 | set(gca, 'FontSize', 16) 43 | set(gca, 'Position', [0.15 0.15 0.75 0.7]) 44 | set(gca, 'XLim', [test.x1(1) test.x2(1)]) 45 | set(gca, 'YLim', [test.x1(2) test.x2(2)]) 46 | set(gca, 'ZLim', [-1 1]) 47 | set(gca, 'XTick', test.x1(1):5:test.x2(1)) 48 | set(gca, 'YTick', test.x1(2):5:test.x2(2)) 49 | set(gca, 'ZTick', [-1 0 1]) 50 | xlabel('x_1', 'FontSize', 16) 51 | ylabel('x_2', 'FontSize', 16) 52 | zlabel('y', 'FontSize', 16) 53 | figure(fig2) 54 | grid on 55 | set(gca, 'FontSize', 16) 56 | set(gca, 'Position', [0.15 0.15 0.75 0.7]) 57 | set(gca, 'XLim', [test.x1(1) test.x2(1)]) 58 | set(gca, 'YLim', [test.x1(2) test.x2(2)]) 59 | set(gca, 'ZLim', [-1 1]) 60 | set(gca, 'XTick', test.x1(1):5:test.x2(1)) 61 | set(gca, 'YTick', test.x1(2):5:test.x2(2)) 62 | set(gca, 'ZTick', [-1 0 1]) 63 | xlabel('x_1', 'FontSize', 16) 64 | ylabel('x_2', 'FontSize', 16) 65 | zlabel('y', 'FontSize', 16) 66 | 67 | % Save postscript. 68 | figure(fig1) 69 | print -depsc fig1 70 | figure(fig2) 71 | print -depsc fig2 72 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/man/examples/intro/fig1.m: -------------------------------------------------------------------------------- 1 | % Figure 1 in the Tutorial Introduction. 2 | clear 3 | 4 | % Training set. 5 | conf.name = 'hermite'; 6 | conf.p = 100; 7 | [x, y] = get_data(conf); 8 | 9 | % Test set. 10 | conf.p = 1000; 11 | conf.ord = 1; 12 | conf.std = 0; 13 | [xt, yt] = get_data(conf); 14 | 15 | % Get figure. 16 | fig = get_fig('Figure 1'); 17 | 18 | % Plot. 19 | hold off 20 | plot(xt, yt, 'k--', 'LineWidth', 1) 21 | hold on 22 | plot(x, y, 'r*', 'MarkerSize', 8) 23 | 24 | % Configure plot. 25 | set(gca, 'FontSize', 16) 26 | set(gca, 'Position', [0.1 0.15 0.85 0.8]) 27 | set(gca, 'XLim', [-4 4]) 28 | set(gca, 'YLim', [0 3]) 29 | set(gca, 'XTick', -4:2:4) 30 | set(gca, 'YTick', 0:3) 31 | xlabel('x', 'FontSize', 16) 32 | ylabel('y', 'FontSize', 16, 'Rotation', 0) 33 | legend('test', 'training') 34 | 35 | % Save postscript. 36 | print -depsc fig1 37 | 38 | 39 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/man/examples/intro/fig3.m: -------------------------------------------------------------------------------- 1 | % Figure 3 in the Tutorial Introduction. 2 | clear 3 | 4 | % Test set. 5 | x = linspace(0, 1, 100); 6 | 7 | % Get figure. 8 | fig = get_fig('Figure 3'); 9 | 10 | % Centre and radius. 11 | c = 0.5; 12 | r = 0.2; 13 | 14 | % Gaussian, Cuachy and Multiquadric RBFs. 15 | h1 = rbf_dm(x, c, r, struct('type', 'm')); 16 | h2 = rbf_dm(x, c, r, struct('type', 'c')); 17 | h3 = rbf_dm(x, c, r, struct('type', 'g')); 18 | 19 | % Plot. 20 | hold off 21 | plot(x, h1, 'r-', 'LineWidth', 2) 22 | hold on 23 | plot(x, h2, 'g-', 'LineWidth', 2) 24 | plot(x, h3, 'b-', 'LineWidth', 2) 25 | 26 | % Configure plot. 27 | set(gca, 'FontSize', 16) 28 | set(gca, 'Position', [0.1 0.15 0.85 0.8]) 29 | set(gca, 'XLim', [0 1]) 30 | set(gca, 'YLim', [-0.5 1.5]) 31 | set(gca, 'XTick', [0 1]) 32 | set(gca, 'YTick', [0 1]) 33 | xlabel('x', 'FontSize', 16) 34 | ylabel('h', 'FontSize', 16, 'Rotation', 0) 35 | legend('type ''m''', 'type ''c''', 'type ''g''', 4) 36 | 37 | % Save postscript. 38 | print -depsc fig3 39 | 40 | 41 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/man/examples/intro/fig4.m: -------------------------------------------------------------------------------- 1 | % Figure 4 in the Tutorial Introduction. 2 | clear 3 | 4 | % Hermite training data. 5 | [x, y, conf] = get_data('hermite'); 6 | 7 | % Test data. 8 | conf.p = 1000; 9 | conf.ord = 1; 10 | conf.std = 0; 11 | [xt, yt] = get_data(conf); 12 | 13 | % Set up network centres and radii. 14 | c = x; 15 | r = 0.4; 16 | 17 | % Compute training set design matrix (use defaults). 18 | H = rbf_dm(x, c, r); 19 | 20 | % Solve for the weights. Probable numerical errors so use pinv not inv. 21 | w = pinv(H' * H) * (H' * y); 22 | 23 | % Now do the test set prediction. 24 | Ht = rbf_dm(xt, c, r); 25 | ft = Ht * w; 26 | 27 | % Get figure. 28 | fig = get_fig('Figure 4'); 29 | 30 | % Plot. 31 | hold off 32 | plot(xt, yt, 'k--') 33 | hold on 34 | plot(xt, ft, 'r-', 'LineWidth', 2) 35 | 36 | % Configure plot. 37 | set(gca, 'FontSize', 16) 38 | set(gca, 'Position', [0.1 0.15 0.85 0.8]) 39 | set(gca, 'XLim', [-4 4]) 40 | set(gca, 'YLim', [0 3]) 41 | set(gca, 'XTick', -4:2:4) 42 | set(gca, 'YTick', 0:3) 43 | xlabel('x', 'FontSize', 16) 44 | ylabel('y', 'FontSize', 16, 'Rotation', 0) 45 | legend('target', 'prediction') 46 | 47 | % Save postscript. 48 | print -depsc fig4 49 | 50 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/man/examples/plot_ras/fig2b.m: -------------------------------------------------------------------------------- 1 | % Add MARS results and plot Figure 2 of the plot_ras manual page. 2 | clear 3 | 4 | % Load results (methods, sizes, perfs) 5 | % calculated by fig2a.m and put in fig2.mat. 6 | load fig2 7 | 8 | % Add best MARS results. 9 | perfs(1, 3, 1) = 0.28; % mean for 100 cases 10 | perfs(1, 3, 2) = 0.17; % std for 100 cases 11 | perfs(2, 3, 1) = 0.12; % mean for 200 cases 12 | perfs(2, 3, 2) = 0.07; % std for 200 cases 13 | 14 | % Diagram title. 15 | data = 'friedman/Z'; 16 | 17 | % Dummy pvals. 18 | pvals = ones(nsiz, nmet, nmet); 19 | pvals(1, :, :) = [ 0 0 0; -1 0 -1; -1 -1 0]; 20 | pvals(2, :, :) = [ 0 0 0; -1 0 -1; -1 -1 0]; 21 | 22 | % Create the Rasmussen diagram. 23 | plot_ras(data, methods, sizes, perfs, pvals) 24 | 25 | % Save postscript. 26 | print -depsc fig2 27 | 28 | % Save results for the fig3.m script. 29 | save fig3 data methods sizes perfs pvals 30 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/man/examples/plot_ras/fig3.m: -------------------------------------------------------------------------------- 1 | % Figure 3 of the plot_ras manual page. 2 | clear 3 | 4 | % Load results (data, methods, sizes, perfs) 5 | % calculated by fig2b.m and put in fig3.mat. 6 | load fig3 7 | 8 | % Configure the Rasmuusen plot. 9 | conf.width = 8; 10 | conf.mfs = 14; 11 | conf.afs = 16; 12 | conf.ebc = 'mrb'; 13 | conf.ebs = [2 3 2]; 14 | conf.mnc = 'mrb'; 15 | 16 | % Create the Rasmussen diagram. 17 | plot_ras(data, methods, sizes, perfs, pvals, conf) 18 | 19 | % Save postscript. 20 | print -depsc fig3 21 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/man/examples/rbf_dm/fig1.m: -------------------------------------------------------------------------------- 1 | % Figure 1 in the rbf_dm manual page. 2 | clear 3 | 4 | % Set of ordered, evenly spaced x-values. 5 | x = linspace(-4, 4, 1000); 6 | 7 | % Gaussian, Cauchy, Multiquadric and Inverse RBFs. 8 | m = rbf_dm(x, 0, 1, struct('type', 'm')); 9 | i = rbf_dm(x, 0, 1, struct('type', 'i')); 10 | c = rbf_dm(x, 0, 1, struct('type', 'c')); 11 | g = rbf_dm(x, 0, 1, struct('type', 'g')); 12 | 13 | % Get figure. 14 | fig = get_fig('Figure 1'); 15 | 16 | % Plot. 17 | hold off 18 | plot(x, m, 'm-', 'LineWidth', 2) 19 | hold on 20 | plot(x, i, 'r-', 'LineWidth', 2) 21 | plot(x, c, 'c-', 'LineWidth', 2) 22 | plot(x, g, 'g-', 'LineWidth', 2) 23 | 24 | % Configure plot. 25 | set(gca, 'FontSize', 16) 26 | set(gca, 'Position', [0.1 0.15 0.85 0.8]) 27 | set(gca, 'XLim', [-4 4]) 28 | set(gca, 'YLim', [0 2]) 29 | set(gca, 'XTick', [-4 -2 0 2 4]) 30 | set(gca, 'YTick', [0 1 2]) 31 | xlabel('x', 'FontSize', 16) 32 | ylabel('h', 'FontSize', 16, 'Rotation', 0) 33 | legend('Multiquadric', 'Inverse', 'Cauchy', 'Gaussian') 34 | 35 | % Save postscript. 36 | print -depsc fig1 37 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/man/examples/rbf_dm/fig2.m: -------------------------------------------------------------------------------- 1 | % Figure 2 in the rbf_dm manual page. 2 | clear 3 | 4 | % Set of ordered, evenly spaced x-values. 5 | x = linspace(-2, 2, 1000); 6 | 7 | % Gaussian, Cauchy, Multiquadric and Inverse RBFs. 8 | g1 = rbf_dm(x, 0, 1, struct('exp', 1)); 9 | g2 = rbf_dm(x, 0, 1, struct('exp', 2)); 10 | g3 = rbf_dm(x, 0, 1, struct('exp', 3)); 11 | g4 = rbf_dm(x, 0, 1, struct('exp', 4)); 12 | 13 | % Get figure. 14 | fig = get_fig('Figure 2'); 15 | 16 | % Plot. 17 | hold off 18 | plot(x, g4, 'b-', 'LineWidth', 2) 19 | hold on 20 | plot(x, g3, 'c-', 'LineWidth', 2) 21 | plot(x, g2, 'g-', 'LineWidth', 2) 22 | plot(x, g1, 'y-', 'LineWidth', 2) 23 | 24 | % Configure plot. 25 | set(gca, 'FontSize', 16) 26 | set(gca, 'Position', [0.1 0.15 0.85 0.8]) 27 | set(gca, 'XLim', [-2 2]) 28 | set(gca, 'YLim', [0 1]) 29 | set(gca, 'XTick', [-2 0 2]) 30 | set(gca, 'YTick', [0 1]) 31 | xlabel('x', 'FontSize', 16) 32 | ylabel('h', 'FontSize', 16, 'Rotation', 0) 33 | legend('4', '3', '2', '1') 34 | 35 | % Save postscript. 36 | print -depsc fig2 37 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/man/examples/rbf_dm/fig3.m: -------------------------------------------------------------------------------- 1 | % Figure 3 in the rbf_dm manual page. 2 | clear 3 | 4 | % Use get_data for grid of x-values. 5 | conf.name = 'sine2'; 6 | conf.p = 1600; 7 | conf.ord = 1; 8 | [X, y, conf] = get_data(conf); 9 | 10 | % Setup centres. 11 | C = [5 7 2; 2 0 -3]; 12 | 13 | % Setup radii. 14 | R = [2 1 1; 1 3 1]; 15 | 16 | % Design matrix. 17 | H = rbf_dm(X, C, R); 18 | 19 | % Weights. 20 | w = [2; 1; 0.5]; 21 | 22 | % Function. 23 | f = H * w; 24 | 25 | % Grid the function. 26 | q = sqrt(conf.p); 27 | F = zeros(q, q); 28 | F(:) = f; 29 | v1 = linspace(conf.x1(1), conf.x2(1), q); 30 | v2 = linspace(conf.x1(2), conf.x2(2), q); 31 | 32 | % Get a figure. 33 | fig = get_fig('Figure 3'); 34 | 35 | % Plot. 36 | hold off 37 | mesh(v1, v2, F); 38 | 39 | % Configure plot. 40 | set(gca, 'FontSize', 16) 41 | set(gca, 'Position', [0.1 0.15 0.85 0.8]) 42 | set(gca, 'XLim', [conf.x1(1) conf.x2(1)]) 43 | set(gca, 'YLim', [conf.x1(2) conf.x2(2)]) 44 | set(gca, 'ZLim', [0 2]) 45 | set(gca, 'XTick', conf.x1(1):5:conf.x2(1)) 46 | set(gca, 'YTick', conf.x1(2):5:conf.x2(2)) 47 | set(gca, 'ZTick', [0 1 2]) 48 | xlabel('x_1', 'FontSize', 16) 49 | ylabel('x_2', 'FontSize', 16) 50 | zlabel('y', 'FontSize', 16) 51 | 52 | % Save postscript. 53 | print -depsc fig3 54 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/man/examples/rbf_fs_2/fig1.m: -------------------------------------------------------------------------------- 1 | % Figure 1 in the rbf_fs_2 manual page. 2 | clear 3 | 4 | % Hermite training data. 5 | [x, y] = get_data('hermite'); 6 | 7 | % Test data. 8 | test.name = 'hermite'; 9 | test.p = 1000; 10 | test.ord = 1; 11 | test.std = 0; 12 | [xt, yt] = get_data(test); 13 | 14 | % Run the method (with a small regularisation parameter). 15 | [c, r, w] = rbf_fs_2(x, y); 16 | 17 | % Now do the test set predictions. 18 | Ht = rbf_dm(xt, c, r); 19 | ft = Ht * w; 20 | 21 | % Get figure. 22 | fig = get_fig('Figure 1'); 23 | 24 | % Plot. 25 | hold off 26 | plot(xt, yt, 'k--') 27 | hold on 28 | plot(xt, ft, 'r-', 'LineWidth', 2) 29 | 30 | % Configure plot. 31 | set(gca, 'FontSize', 16) 32 | set(gca, 'Position', [0.1 0.15 0.85 0.8]) 33 | set(gca, 'XLim', [-4 4]) 34 | set(gca, 'YLim', [0 3]) 35 | set(gca, 'XTick', -4:2:4) 36 | set(gca, 'YTick', 0:3) 37 | xlabel('x', 'FontSize', 16) 38 | ylabel('y', 'FontSize', 16, 'Rotation', 0) 39 | legend('target', 'prediction') 40 | 41 | % Save postscript. 42 | print -depsc fig1 43 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/man/examples/rbf_fs_2/fig2.m: -------------------------------------------------------------------------------- 1 | % Figure 2 in the rbf_fs_2 manual page. 2 | clear 3 | 4 | % Hermite training data. 5 | [x, y] = get_data('hermite'); 6 | 7 | % Test data. 8 | test.name = 'hermite'; 9 | test.p = 1000; 10 | test.ord = 1; 11 | test.std = 0; 12 | [xt, yt] = get_data(test); 13 | 14 | % Configure the method. 15 | conf.scales = [1 0.5 0.2 0.1]; 16 | conf.type = 'cauchy'; 17 | conf.bias = 1; 18 | conf.msc = 'BIC'; 19 | 20 | % Run the method. 21 | [c, r, w, info] = rbf_fs_2(x, y, conf); 22 | 23 | % Now do the test set predictions. 24 | Ht = rbf_dm(xt, c, r, info.dmc); 25 | ft = Ht * w; 26 | 27 | % Get figure. 28 | fig = get_fig('Figure 2'); 29 | 30 | % Plot. 31 | hold off 32 | plot(xt, yt, 'k--') 33 | hold on 34 | plot(xt, ft, 'r-', 'LineWidth', 2) 35 | 36 | % Configure plot. 37 | set(gca, 'FontSize', 16) 38 | set(gca, 'Position', [0.1 0.15 0.85 0.8]) 39 | set(gca, 'XLim', [-4 4]) 40 | set(gca, 'YLim', [0 3]) 41 | set(gca, 'XTick', -4:2:4) 42 | set(gca, 'YTick', 0:3) 43 | xlabel('x', 'FontSize', 16) 44 | ylabel('y', 'FontSize', 16, 'Rotation', 0) 45 | legend('target', 'prediction') 46 | 47 | % Save postscript. 48 | print -depsc fig2 49 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/man/examples/rbf_rr_2/fig1.m: -------------------------------------------------------------------------------- 1 | % Figure 1 in the rbf_rr_2 manual page. 2 | clear 3 | 4 | % Hermite training data. 5 | [x, y] = get_data('hermite'); 6 | 7 | % Test data. 8 | test.name = 'hermite'; 9 | test.p = 1000; 10 | test.ord = 1; 11 | test.std = 0; 12 | [xt, yt] = get_data(test); 13 | 14 | % Configure the method. 15 | conf.msc = 'GCV'; 16 | conf.scales = [0.2 0.1]; 17 | conf.lambdas = 10.^[-2:-2:-10]; 18 | 19 | % Run the method. 20 | [c, r, w] = rbf_rr_2(x, y, conf); 21 | 22 | % Now do the test set predictions. 23 | Ht = rbf_dm(xt, c, r); 24 | ft = Ht * w; 25 | 26 | % Get figure. 27 | fig = get_fig('Figure 1'); 28 | 29 | % Plot. 30 | hold off 31 | plot(xt, yt, 'k--') 32 | hold on 33 | plot(xt, ft, 'r-', 'LineWidth', 2) 34 | 35 | % Configure plot. 36 | set(gca, 'FontSize', 16) 37 | set(gca, 'Position', [0.1 0.15 0.85 0.8]) 38 | set(gca, 'XLim', [-4 4]) 39 | set(gca, 'YLim', [0 3]) 40 | set(gca, 'XTick', -4:2:4) 41 | set(gca, 'YTick', 0:3) 42 | xlabel('x', 'FontSize', 16) 43 | ylabel('y', 'FontSize', 16, 'Rotation', 0) 44 | legend('target', 'prediction') 45 | 46 | % Save postscript. 47 | print -depsc fig1 48 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/man/examples/rbf_rr_2/fig2.m: -------------------------------------------------------------------------------- 1 | % Figure 2 in the rbf_rr_2 manual page. 2 | clear 3 | 4 | % Hermite training data. 5 | [x, y] = get_data('hermite'); 6 | 7 | % Test data. 8 | test.name = 'hermite'; 9 | test.p = 1000; 10 | test.ord = 1; 11 | test.std = 0; 12 | [xt, yt] = get_data(test); 13 | 14 | % Configure the method. 15 | conf.lambdas = 10.^[-2:-2:-10]; 16 | conf.scales = [0.2 0.1]; 17 | conf.msc = 'GCV'; 18 | 19 | % Run the method. 20 | [c, r, w, info] = rbf_rr_2(x, y, conf); 21 | 22 | % Calculate GCV as a function of lambda. 23 | H = info.H; HH = H' * H; [p,m] = size(H); 24 | lams = 10.^linspace(-10,0,50); 25 | for i = 1:length(lams) 26 | A = inv(HH + lams(i)*eye(m)); 27 | P = eye(p) - H * A * H'; 28 | errs(i) = p * (y' * P) * (P * y) / trace(P)^2; 29 | end 30 | 31 | % Get figure. 32 | fig = get_fig('Figure 2'); 33 | 34 | % Plot. 35 | hold off 36 | plot(log10(info.lams), log10(info.errs), 'r+', 'MarkerSize', 10) 37 | hold on 38 | plot(log10(lams), log10(errs), 'm-', 'LineWidth', 2) 39 | 40 | % Configure plot. 41 | dy = 0.1; 42 | y1 = dy * floor(min(log10(info.errs)) / dy); 43 | y2 = dy * ceil(max(log10(info.errs)) / dy); 44 | set(gca, 'FontSize', 14) 45 | set(gca, 'Position', [0.15 0.15 0.8 0.8]) 46 | set(gca, 'XLim', [-10 0]) 47 | set(gca, 'YLim', [y1 y2]) 48 | set(gca, 'XTick', -10:2:0) 49 | set(gca, 'YTick', y1:dy:y2) 50 | xlabel('log(\lambda)', 'FontSize', 14) 51 | ylabel('log(GCV)', 'FontSize', 14) 52 | 53 | % Save postscript. 54 | % print -depsc fig2 55 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/man/examples/rbf_rr_2/fig3.m: -------------------------------------------------------------------------------- 1 | % Figure 3 in the rbf_rr_2 manual page. 2 | clear 3 | 4 | % Hermite training data. 5 | [x, y] = get_data('hermite'); 6 | 7 | % Test data. 8 | test.name = 'hermite'; 9 | test.p = 1000; 10 | test.ord = 1; 11 | test.std = 0; 12 | [xt, yt] = get_data(test); 13 | 14 | % Don't configure scales so RBFs are too large. 15 | conf.msc = 'GCV'; 16 | 17 | % Run the method. 18 | [c, r, w, info] = rbf_rr_2(x, y, conf); 19 | 20 | % Calculate GCV as a function of lambda. 21 | H = info.H; HH = H' * H; [p,m] = size(H); 22 | lams = 10.^linspace(-10,0,50); 23 | for i = 1:length(lams) 24 | A = inv(HH + lams(i)*eye(m)); 25 | P = eye(p) - H * A * H'; 26 | errs(i) = p * (y' * P) * (P * y) / trace(P)^2; 27 | end 28 | 29 | % Get figure. 30 | fig = get_fig('Figure 3'); 31 | 32 | % Plot. 33 | hold off 34 | plot(log10(info.lams), log10(info.errs), 'r+', 'MarkerSize', 10) 35 | hold on 36 | plot(log10(lams), log10(errs), 'm-', 'LineWidth', 2) 37 | 38 | % Configure plot. 39 | dy = 0.2; 40 | y1 = dy * floor(min(log10(info.errs)) / dy); 41 | y2 = dy * ceil(max(log10(info.errs)) / dy); 42 | set(gca, 'FontSize', 14) 43 | set(gca, 'Position', [0.15 0.15 0.8 0.8]) 44 | set(gca, 'XLim', [-10 0]) 45 | set(gca, 'YLim', [y1 y2]) 46 | set(gca, 'XTick', -10:2:0) 47 | set(gca, 'YTick', y1:dy:y2) 48 | xlabel('log(\lambda)', 'FontSize', 14) 49 | ylabel('log(GCV)', 'FontSize', 14) 50 | 51 | % Save postscript. 52 | % print -depsc fig3 53 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/man/examples/rbf_rt_1/fig1.m: -------------------------------------------------------------------------------- 1 | % Figure 1 in the rbf_rt_1 manual page. 2 | clear 3 | 4 | % Hermite training data. 5 | [x, y] = get_data('hermite'); 6 | 7 | % Test data. 8 | test.name = 'hermite'; 9 | test.p = 1000; 10 | test.ord = 1; 11 | test.std = 0; 12 | [xt, yt] = get_data(test); 13 | 14 | % Run the method with the default configuration. 15 | [c, r, w, info] = rbf_rt_1(x, y); 16 | 17 | % Now do the test set predictions. 18 | Ht = rbf_dm(xt, c, r, info.dmc); 19 | ft = Ht * w; 20 | 21 | % Get figure. 22 | fig = get_fig('Figure 1'); 23 | 24 | % Plot. 25 | hold off 26 | plot(xt, yt, 'k--') 27 | hold on 28 | plot(xt, ft, 'r-', 'LineWidth', 2) 29 | 30 | % Configure plot. 31 | set(gca, 'FontSize', 16) 32 | set(gca, 'Position', [0.1 0.15 0.85 0.8]) 33 | set(gca, 'XLim', [-4 4]) 34 | set(gca, 'YLim', [0 3]) 35 | set(gca, 'XTick', -4:2:4) 36 | set(gca, 'YTick', 0:3) 37 | xlabel('x', 'FontSize', 16) 38 | ylabel('y', 'FontSize', 16, 'Rotation', 0) 39 | legend('target', 'prediction') 40 | 41 | % Save postscript. 42 | print -depsc fig1 43 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/man/examples/rbf_rt_1/fig2.m: -------------------------------------------------------------------------------- 1 | % Figure 2 in the rbf_rt_1 manual page. 2 | clear 3 | 4 | % Hermite training data. 5 | [x, y] = get_data('hermite'); 6 | 7 | % Test data. 8 | test.name = 'hermite'; 9 | test.p = 1000; 10 | test.ord = 1; 11 | test.std = 0; 12 | [xt, yt] = get_data(test); 13 | 14 | % Run the method with the default configuration. 15 | [c, r, w, info] = rbf_rt_1(x, y); 16 | 17 | % Predict from the tree, not the RBF. 18 | ft = pred_tree(info.tree, xt); 19 | 20 | % Get figure. 21 | fig = get_fig('Figure 1'); 22 | 23 | % Plot. 24 | hold off 25 | plot(xt, yt, 'k--') 26 | hold on 27 | plot(xt, ft, 'r-', 'LineWidth', 2) 28 | 29 | % Configure plot. 30 | set(gca, 'FontSize', 16) 31 | set(gca, 'Position', [0.1 0.15 0.85 0.8]) 32 | set(gca, 'XLim', [-4 4]) 33 | set(gca, 'YLim', [0 3]) 34 | set(gca, 'XTick', -4:2:4) 35 | set(gca, 'YTick', 0:3) 36 | xlabel('x', 'FontSize', 16) 37 | ylabel('y', 'FontSize', 16, 'Rotation', 0) 38 | legend('target', 'prediction') 39 | 40 | % Save postscript. 41 | print -depsc fig2 42 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/man/examples/rbf_rt_1/friedman.m: -------------------------------------------------------------------------------- 1 | % The 4D example in the rbf_rt_1 manual page. 2 | clear 3 | 4 | % 4D data set. 5 | [X, y] = get_data('friedman'); 6 | 7 | % Configure the method. 8 | conf.minmem = [3 4 5]; 9 | conf.scales = [7 8 9]; 10 | conf.timer = '4D'; 11 | 12 | % Run the method. 13 | [C, R, w, info] = rbf_rt_1(X, y, conf); 14 | 15 | % Print out split statistics. 16 | disp(info.tree.split.number) 17 | disp(info.tree.split.order) -------------------------------------------------------------------------------- /ORION3_0/rbf2/man/examples/rbf_rt_2/fig1.m: -------------------------------------------------------------------------------- 1 | % Figure 1 in the rbf_rt_2 manual page. 2 | clear 3 | 4 | % Hermite training data. 5 | [x, y] = get_data('hermite'); 6 | 7 | % Test data. 8 | test.name = 'hermite'; 9 | test.p = 1000; 10 | test.ord = 1; 11 | test.std = 0; 12 | [xt, yt] = get_data(test); 13 | 14 | % Run the method with the default configuration. 15 | [c, r, w, info] = rbf_rt_2(x, y); 16 | 17 | % Now do the test set predictions. 18 | Ht = rbf_dm(xt, c, r, info.dmc); 19 | ft = Ht * w; 20 | 21 | % Get figure. 22 | fig = get_fig('Figure 1'); 23 | 24 | % Plot. 25 | hold off 26 | plot(xt, yt, 'k--') 27 | hold on 28 | plot(xt, ft, 'r-', 'LineWidth', 2) 29 | 30 | % Configure plot. 31 | set(gca, 'FontSize', 16) 32 | set(gca, 'Position', [0.1 0.15 0.85 0.8]) 33 | set(gca, 'XLim', [-4 4]) 34 | set(gca, 'YLim', [0 3]) 35 | set(gca, 'XTick', -4:2:4) 36 | set(gca, 'YTick', 0:3) 37 | xlabel('x', 'FontSize', 16) 38 | ylabel('y', 'FontSize', 16, 'Rotation', 0) 39 | legend('target', 'prediction') 40 | 41 | % Save postscript. 42 | print -depsc fig1 43 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/man/examples/rbf_rt_2/fig2.m: -------------------------------------------------------------------------------- 1 | % Figure 2 in the rbf_rt_2 manual page. 2 | clear 3 | 4 | % Hermite test data. 5 | test.name = 'hermite'; 6 | test.p = 1000; 7 | test.ord = 1; 8 | test.std = 0; 9 | [xt, yt] = get_data(test); 10 | 11 | % Timer. 12 | tmr = get_tmr(struct('name', 'fig 2', 'n', 2*100)); 13 | 14 | % Loop over replications training and testing both rt versions. 15 | for rep = 1:100 16 | 17 | % Hermite training data. 18 | [x, y] = get_data('hermite'); 19 | 20 | % First version. 21 | [c, r, w, info] = rbf_rt_1(x, y); 22 | Ht = rbf_dm(xt, c, r, info.dmc); 23 | ft = Ht * w; 24 | err(rep,1) = sqrt((yt - ft)' * (yt - ft) / length(yt)); 25 | 26 | % Increment timer. 27 | inc_tmr(tmr) 28 | 29 | % Second version. 30 | [c, r, w, info] = rbf_rt_2(x, y); 31 | Ht = rbf_dm(xt, c, r, info.dmc); 32 | ft = Ht * w; 33 | err(rep,2) = sqrt((yt - ft)' * (yt - ft) / length(yt)); 34 | 35 | % Increment timer. 36 | inc_tmr(tmr) 37 | 38 | end 39 | 40 | % Close the timer. 41 | close(tmr) 42 | 43 | % Print average errors. 44 | fprintf('rbf_rt_1: %.3f +/- %.3f\n', mean(err(:,1)), std(err(:,1))) 45 | fprintf('rbf_rt_2: %.3f +/- %.3f\n', mean(err(:,2)), std(err(:,2))) 46 | 47 | % Get figure. 48 | fig = get_fig('Figure 1'); 49 | 50 | % Plot. 51 | de = 0.1; 52 | e1 = de*floor(min(min(err))/de); 53 | e2 = de*ceil(max(max(err))/de); 54 | hold off 55 | plot([e1 e2], [e1 e2], 'k--') 56 | hold on 57 | plot(err(:,1), err(:,2), 'r.') 58 | 59 | % Configure plot. 60 | set(gca, 'FontSize', 16) 61 | set(gca, 'Position', [0.15 0.15 0.8 0.8]) 62 | set(gca, 'XLim', [e1 e2]) 63 | set(gca, 'YLim', [e1 e2]) 64 | set(gca, 'XTick', e1:de:e2) 65 | set(gca, 'YTick', e1:de:e2) 66 | xlabel('rbf\_rt\_1', 'FontSize', 16) 67 | ylabel('rbf\_rt\_2', 'FontSize', 16) 68 | 69 | % Save postscript. 70 | print -depsc fig2 71 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/man/intro.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/ORION3_0/rbf2/man/intro.pdf -------------------------------------------------------------------------------- /ORION3_0/rbf2/man/manual.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/ORION3_0/rbf2/man/manual.pdf -------------------------------------------------------------------------------- /ORION3_0/rbf2/meth/Contents.m: -------------------------------------------------------------------------------- 1 | % Regression methods involving radial basis functions (RBFs). 2 | % 3 | % rbf_fs_2 - Regularised forward selection using radial basis functions. 4 | % rbf_rr_2 - Ridge regression using radial basis functions. 5 | % rbf_rt_1 - Hybrid radial basis function network and regression tree. 6 | % rbf_rt_2 - Hybrid radial basis function network and regression tree. 7 | % 8 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/util/Contents.m: -------------------------------------------------------------------------------- 1 | % Various utilities for the RBF package. 2 | % 3 | % conf_check - Check the legality of a configuration against its specification. 4 | % conf_print - Print a configuration specification, or one part of it. 5 | % get_data - Get training or test data for a simulated learning problem. 6 | % get_fig - Create a new figure or grab an old one with the same name. 7 | % get_tmr - Setup a graphical timer to monitor the progress of a loop. 8 | % grow_tree - Grow a regression tree by recursive splitting. 9 | % inc_tmr - Increment a graphical timer during one iteration of a loop. 10 | % isstring - Returns true if the argument is a row vector of characters. 11 | % plot_ras - Plots a Rasmussen diagram to compare different methods. 12 | % pred_tree - Predict using a tree structure returned from grow_tree. 13 | % rbf_dm - Generate a design matrix using RBF functions. 14 | % rbf_ver - Prints information about the current RBF package. 15 | % run_demo - Runs one of the demos defined in ../demo. 16 | % tree_rbf - Translates a tree into RBF centres and radii. 17 | % 18 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/util/get_data.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/ORION3_0/rbf2/util/get_data.mat -------------------------------------------------------------------------------- /ORION3_0/rbf2/util/inc_tmr.m: -------------------------------------------------------------------------------- 1 | function inc_timer(fh) 2 | % 3 | % Increment a graphical timer during one iteration of a loop. 4 | % 5 | % Input is a figure handle made by get_tmr.m. 6 | % 7 | % For further details of the function see: 8 | % 9 | % 'Matlab Routines for RBF Networks', 1999. 10 | % 11 | 12 | % Bring the figure to the fore and get its data. 13 | figure(fh) 14 | data = get(fh, 'UserData'); 15 | 16 | % Get what we need from the data. 17 | d = data.conf; 18 | i = d(1); 19 | n = d(2); 20 | p = d(3); 21 | name = data.name; 22 | 23 | % Increment. 24 | i = i + 1; 25 | 26 | % If the increment is valid, update the timer. 27 | if i > 0 & i <= n 28 | 29 | % Calculate and set the new patch parameters. 30 | x = i/n; 31 | v = get(p, 'Vertices'); 32 | v(2,1) = x; 33 | v(3,1) = x; 34 | set(p, 'Vertices', v); 35 | 36 | % Add 'i of n' to the title. 37 | set(fh, 'Name', [name ' (' num2str(i) ' of ' num2str(n) ')']) 38 | 39 | % Store the updated parametes back in the figure. 40 | data.conf = [i n p]; 41 | set(fh, 'UserData', data); 42 | 43 | % Make sure it's rendered now. 44 | drawnow 45 | 46 | end 47 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/util/isstring.m: -------------------------------------------------------------------------------- 1 | function ret = isstring(obj) 2 | % 3 | % Returns true if the argument is a row vector of characters. 4 | % 5 | ret = ischar(obj) & ndims(obj) == 2 & size(obj,1) == 1; 6 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/util/pred_tree.m: -------------------------------------------------------------------------------- 1 | function y = pred_tree(tree, X) 2 | % 3 | % Predict using a tree structure returned from grow_tree. 4 | % 5 | % Predict the outputs from a tree given some inputs (X). 6 | % The tree will have been returned from the the utility 7 | % grow_tree (or from the methods rbf_rt_1 or rbf_rt_2). 8 | % 9 | % For further details of the function see: 10 | % 11 | % 'Matlab Routines for RBF Networks', 1999. 12 | % 13 | 14 | prog = 'pred_tree'; 15 | 16 | % Check arguments. 17 | if nargin ~= 2 18 | error([prog ': needs two arguments']) 19 | end 20 | if ~isstruct(tree) 21 | error([prog ': first arg (tree) needs to be a struct']) 22 | end 23 | if ~(isnumeric(X) & ndims(X) == 2) 24 | error([prog ': second arg (X) needs to be a numerical matrix']) 25 | end 26 | 27 | % Check dimensionality. 28 | [d,p] = size(X); 29 | if tree.d ~= d 30 | error([prog ': tree and inputs do not share same dimension']) 31 | end 32 | 33 | % Recurse down the tree. 34 | y = downTree(tree, X, 1); 35 | 36 | function y = downTree(t, X, k) 37 | 38 | % Which node are we at? 39 | n = t.node(k); 40 | 41 | % Are we at a terminal node? 42 | if isempty(n.split) 43 | 44 | % Give these inputs the node's average value. 45 | y = n.ave * ones(size(X,2),1); 46 | 47 | else 48 | 49 | % Divide. 50 | s = n.split; 51 | l = find(X(s.dim,:) <= s.val); 52 | r = find(X(s.dim,:) > s.val); 53 | 54 | % Recurse. 55 | yl = downTree(t, X(:,l), s.l); 56 | yr = downTree(t, X(:,r), s.r); 57 | 58 | % Recombine. 59 | y = zeros(size(X,2),1); 60 | y(l) = yl; 61 | y(r) = yr; 62 | 63 | end 64 | -------------------------------------------------------------------------------- /ORION3_0/rbf2/util/rbf_ver.m: -------------------------------------------------------------------------------- 1 | % 2 | % Prints information about the current RBF package. 3 | % 4 | fprintf('---------------------------------------------------------\n') 5 | fprintf('Matlab Routines for Radial Basis Function Neural Networks\n') 6 | fprintf(' Version 2.2, 1999/06/30\n') 7 | fprintf(' Updates from www.anc.ed.ac.uk/~mjo/rbf.html\n') 8 | fprintf(' Bug reports to Mark Orr (mark@anc.ed.ac.uk)\n') 9 | fprintf('---------------------------------------------------------\n') 10 | -------------------------------------------------------------------------------- /ORION3_0/selected_area_45.txt: -------------------------------------------------------------------------------- 1 | 5 3 3 16 13074.592 2 | 5 2 7 16 23679.23 3 | 7 2 7 64 59272.693 4 | 2 2 7 64 24585.574 5 | 7 2 9 64 82031.998 6 | 2 3 9 24 32193.529 7 | 5 3 5 32 28139.152 8 | 7 5 9 24 113813.809 9 | 5 2 5 24 17294.962 10 | 2 3 3 16 6873.779 11 | 2 7 7 64 73224.875 12 | 5 2 5 32 19737.043 13 | 5 5 5 32 45282.586 14 | 7 7 9 64 262075.363 15 | 5 7 9 24 125311.561 16 | 2 5 9 24 51674.087 17 | 2 3 3 32 8862.336 18 | 3 5 5 24 27495.644 19 | 3 3 9 16 35466.455 20 | 5 5 9 24 89911.08 21 | 2 7 5 16 27345.704 22 | 3 3 5 64 28014.084 23 | 7 5 7 64 134027.309 24 | 2 7 7 24 49693.291 25 | 3 5 9 32 71011.584 26 | 2 2 9 24 23042.603 27 | 5 5 7 16 55137.172 28 | 5 2 7 32 31038.638 29 | 7 7 7 24 112819.442 30 | 5 5 5 16 34494.491 31 | 5 3 7 32 44276.224 32 | 3 2 5 64 19955.074 33 | 7 7 7 64 188930.045 34 | 2 7 5 32 33708.982 35 | 2 3 9 16 28957.118 36 | 7 5 7 24 81091.962 37 | 7 3 9 32 80213.666 38 | 7 2 3 24 13249.757 39 | 5 2 9 16 33941.3 40 | 2 3 9 64 48093.52 41 | 7 3 9 64 115133.458 42 | 5 3 9 64 90232.657 43 | 5 5 3 16 21834.616 44 | 5 5 9 16 79112.048 45 | 7 7 5 32 82389.208 46 | 2 2 3 64 8832.172 47 | 7 7 5 16 61976.905 48 | 7 3 9 24 70371.958 49 | 2 3 3 24 7845.39 50 | 3 3 3 64 17471.891 51 | 5 5 5 24 39975.415 52 | 3 2 9 64 45233.546 53 | 2 2 3 24 5265.54 54 | 5 2 7 64 45466.218 55 | 2 7 3 64 29635.729 56 | 7 7 3 32 54790.722 57 | 3 5 9 24 64379.473 58 | 5 2 5 64 29518.6 59 | 5 2 3 24 10213.031 60 | 2 3 5 16 11882.657 61 | 2 5 7 64 52739.366 62 | 5 3 3 24 15321.575 63 | 7 5 9 16 100570.932 64 | 5 3 9 24 55585.051 65 | -------------------------------------------------------------------------------- /ORION3_0/selected_area_65.txt: -------------------------------------------------------------------------------- 1 | 5 5 5 24 79547.04 2 | 3 7 5 16 67860.72 3 | 2 3 3 24 15219 4 | 7 5 5 16 88073.64 5 | 7 7 9 16 286650 6 | 2 7 5 16 55388.16 7 | 5 7 7 64 284828.4 8 | 3 5 3 64 55417.68 9 | 3 3 9 16 73872.72 10 | 3 2 9 32 63460.8 11 | 3 3 5 24 34050.6 12 | 3 2 7 32 42571.44 13 | 2 5 7 16 65566.08 14 | 5 2 7 16 46652.76 15 | 7 3 7 16 85091.4 16 | 3 5 5 16 48109.32 17 | 5 7 3 64 121438.8 18 | 3 2 3 16 11639.16 19 | 3 2 3 24 13487.4 20 | 5 3 3 64 51885.72 21 | 5 3 5 64 81592.2 22 | 2 7 7 32 113325.84 23 | 3 2 5 16 20750.04 24 | 5 2 5 32 38851.56 25 | 3 2 7 16 33172.2 26 | 7 2 9 32 110138.04 27 | 3 7 9 32 202274.28 28 | 3 7 7 24 127116 29 | 7 3 9 24 143705.52 30 | 5 5 5 64 131139.36 31 | 2 3 3 32 17180.64 32 | 7 2 7 64 116619.84 33 | 5 2 7 24 53903.88 34 | 7 7 3 64 160881.84 35 | 2 2 5 24 18637.2 36 | 7 3 9 32 161960.04 37 | 5 3 9 24 115164.72 38 | 2 5 3 64 40625.64 39 | 2 7 5 32 67983.12 40 | 2 7 7 24 104083.92 41 | 3 3 5 32 38271.6 42 | 5 7 3 32 80677.08 43 | 5 7 7 24 179713.8 44 | 7 2 3 24 26280.36 45 | 5 2 7 32 60937.2 46 | 5 2 7 64 89613.72 47 | 7 7 7 32 258647.4 48 | 2 7 3 24 37180.8 49 | 3 3 9 64 126177.48 50 | 3 5 3 24 33592.68 51 | 5 2 3 16 17036.64 52 | 3 7 9 64 275787.72 53 | 5 7 5 24 109942.92 54 | 2 2 9 32 51612.84 55 | 2 5 5 24 42688.08 56 | 2 3 9 32 73358.28 57 | 3 5 5 32 60894 58 | 3 3 9 32 90923.76 59 | 5 5 3 32 57253.32 60 | 7 2 5 32 49939.92 61 | 5 5 5 32 88621.92 62 | 3 7 3 32 53890.92 63 | 5 7 9 64 404634.96 64 | 2 3 7 64 66272.76 65 | -------------------------------------------------------------------------------- /ORION3_0/sw_pow.txt: -------------------------------------------------------------------------------- 1 | 1.612600 2 | 3.813166 3 | 9.251954 4 | 4.246479 5 | 14.168641 6 | 6.601638 7 | 3.673031 8 | 17.622438 9 | 2.492591 10 | 0.958689 11 | 12.726847 12 | 2.779556 13 | 6.162735 14 | 42.463918 15 | 19.774005 16 | 10.959582 17 | 1.178853 18 | 3.975138 19 | 6.473286 20 | 14.384784 21 | 4.120958 22 | 3.716535 23 | 20.171307 24 | 8.576300 25 | 13.268907 26 | 5.026821 27 | 8.313547 28 | 4.741458 29 | 15.818401 30 | 4.956183 31 | 6.226876 32 | 2.812478 33 | 27.728433 34 | 5.067340 35 | 5.920388 36 | 11.507243 37 | 11.851210 38 | 1.638883 39 | 5.916995 40 | 9.796537 41 | 18.607434 42 | -------------------------------------------------------------------------------- /ORION3_0/test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main() { 7 | FILE *fp; 8 | char line[20]; 9 | float q; 10 | float total; 11 | 12 | fp=fopen("total_area.txt", "r"); 13 | while(fgets(line, 20, fp) != NULL) { 14 | sscanf (line, "%f", &q); 15 | printf ("Total Area:%f\n", q); 16 | } 17 | fclose(fp); 18 | 19 | fp=fopen("int_pow.txt", "r"); 20 | while(fgets(line, 20, fp) != NULL) { 21 | sscanf (line, "%f", &q); 22 | printf ("Internal Power %f \t", q); 23 | } 24 | fclose(fp); 25 | total = total +q; 26 | 27 | fp=fopen("sw_pow.txt", "r"); 28 | while(fgets(line, 20, fp) != NULL) { 29 | sscanf (line, "%f", &q); 30 | printf ("Switching Power:%f \t", q); 31 | } 32 | fclose(fp); 33 | total = total +q; 34 | 35 | fp=fopen("leak_pow.txt", "r"); 36 | while(fgets(line, 20, fp) != NULL) { 37 | sscanf (line, "%f", &q); 38 | printf ("Leakage Power:%f \n", q); 39 | 40 | } 41 | fclose(fp); 42 | total = total +q; 43 | 44 | fp=fopen("leak_pow.txt", "r"); 45 | while(fgets(line, 20, fp) != NULL) { 46 | sscanf (line, "%f", &q); 47 | printf ("Leakage Power:%f \n", q); 48 | } 49 | fclose(fp); 50 | total = total +q; 51 | 52 | printf ("Total Power:%f \n", total); 53 | 54 | 55 | return 1; 56 | } -------------------------------------------------------------------------------- /ORION3_0/test.txt: -------------------------------------------------------------------------------- 1 | 5 3 3 16 2 | 5 2 7 16 3 | 7 2 7 64 4 | 2 2 7 64 5 | 7 2 9 64 6 | 2 3 9 24 7 | 5 3 5 32 8 | 7 5 9 24 9 | 5 2 5 24 10 | 2 3 3 16 11 | 2 7 7 64 12 | 5 2 5 32 13 | 5 5 5 32 14 | 7 7 9 64 15 | 5 7 9 24 16 | 2 5 9 24 17 | 2 3 3 32 18 | 3 5 5 24 19 | 3 3 9 16 20 | 5 5 9 24 21 | 2 7 5 16 22 | 3 3 5 64 23 | 7 5 7 64 24 | 2 7 7 24 25 | 3 5 9 32 26 | 2 2 9 24 27 | 5 5 7 16 28 | 5 2 7 32 29 | 7 7 7 24 30 | 5 5 5 16 31 | 5 3 7 32 32 | 3 2 5 64 33 | 7 7 7 64 34 | 2 7 5 32 35 | 2 3 9 16 36 | 7 5 7 24 37 | 7 3 9 32 38 | 7 2 3 24 39 | 5 2 9 16 40 | 2 3 9 64 41 | 7 3 9 64 42 | -------------------------------------------------------------------------------- /ORION3_0/total_area.txt: -------------------------------------------------------------------------------- 1 | 26155.845527 2 | 47166.406883 3 | 113357.769439 4 | 46980.808876 5 | 163989.373236 6 | 67665.379397 7 | 56133.161542 8 | 218999.344564 9 | 33088.037954 10 | 14017.417844 11 | 153027.234229 12 | 37940.481191 13 | 89302.988278 14 | 530557.269724 15 | 255330.576883 16 | 102974.980330 17 | 17271.286112 18 | 53988.023230 19 | 72213.594055 20 | 172760.460486 21 | 56212.329216 22 | 53379.629380 23 | 250828.452685 24 | 103940.533056 25 | 137146.075167 26 | 47040.683948 27 | 104365.822614 28 | 61728.434615 29 | 224130.025596 30 | 67835.306628 31 | 89163.906351 32 | 36079.365011 33 | 369232.168428 34 | 68783.724684 35 | 61269.450315 36 | 152257.014224 37 | 164539.773025 38 | 26119.562387 39 | 68799.170482 40 | 99124.680721 41 | 235889.494496 42 | -------------------------------------------------------------------------------- /ORION3_0/total_pow.txt: -------------------------------------------------------------------------------- 1 | 8.354706 2 | 15.239604 3 | 37.555924 4 | 14.643909 5 | 54.669478 6 | 22.065961 7 | 17.087319 8 | 70.092563 9 | 10.966140 10 | 4.445091 11 | 46.085847 12 | 12.343601 13 | 27.056701 14 | 169.097236 15 | 76.308529 16 | 34.611961 17 | 5.523631 18 | 16.742060 19 | 22.799117 20 | 54.377785 21 | 16.688556 22 | 16.446987 23 | 82.714445 24 | 31.618631 25 | 45.178464 26 | 16.276883 27 | 32.901795 28 | 19.394065 29 | 67.980898 30 | 21.195604 31 | 26.550724 32 | 11.501079 33 | 116.543319 34 | 20.725815 35 | 19.580928 36 | 48.239115 37 | 49.531479 38 | 8.278986 39 | 22.298487 40 | 32.203592 41 | 75.249764 42 | ABKGROUP_ORION -------------------------------------------------------------------------------- /Parameters/MacroParam.json: -------------------------------------------------------------------------------- 1 | { 2 | "NVM_states": 2, 3 | "MaxConductance": 1e-05, 4 | "MinConductance": 1e-07, 5 | "maxcurrent": 3, 6 | "readVoltage": 0.2, 7 | "readPulseWidth": 1e-08, 8 | "nonlinear_coeff1": 0, 9 | "nonlinear_coeff2": 1, 10 | "nonlinear_coeff3": 0.01, 11 | "Rwire_row": 1, 12 | "Rwire_col": 1, 13 | "Rdrive": 100, 14 | "Rsense": 100, 15 | "NVMSTD": 1, 16 | "Weight_precision": 8, 17 | "ADC_resolution": 8, 18 | "DAC_resolution": 8, 19 | "ADC_power": 0.99988562529703, 20 | "ADC_fre": 2796827098.0277634, 21 | "ADC_area": 5.830196974978962e-08, 22 | "predefinedMacro": false, 23 | "Macro_energy": 4.0810436020564987e-10, 24 | "Macro_delay": 1.89141e-08, 25 | "Macro_area": 0.00113, 26 | "current": 5.5, 27 | "quantization": true, 28 | "nonlinear": false, 29 | "variation": false, 30 | "irdrop": false, 31 | "retrain": true, 32 | "correction": false, 33 | "epoch": 100, 34 | "learning_rate": 0.01 35 | } -------------------------------------------------------------------------------- /Parameters/NNParam.txt: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /Parameters/NeuronsynpaseParam.json: -------------------------------------------------------------------------------- 1 | { 2 | "linear_search": true, 3 | "exponential_search": false, 4 | "initialADCpower": 0.001, 5 | "initialADCSR": 10000000, 6 | "initialADCarea": 0.001, 7 | "upboundADCpower": 1, 8 | "upboundADCSR": 10000000000, 9 | "upboundADCarea": 0.1, 10 | "downboundADCpower": 1e-06, 11 | "downboundADCSR": 100000, 12 | "downboundADCarea": 1e-05, 13 | "initalpoints": [ 14 | 0.001, 15 | 10000000, 16 | 0.001 17 | ], 18 | "upboundaries": [ 19 | 1, 20 | 10000000000, 21 | 0.1 22 | ], 23 | "downboundaries": [ 24 | 1e-06, 25 | 100000, 26 | 1e-05 27 | ] 28 | } -------------------------------------------------------------------------------- /Parameters/OptParam.json: -------------------------------------------------------------------------------- 1 | { 2 | "area": true, 3 | "circuit_optimized": false, 4 | "energy": false, 5 | "evaluate_mode": false, 6 | "f": 100, 7 | "guiding_finish": false, 8 | "init_points": 10, 9 | "latency": false, 10 | "mapping_finish": true, 11 | "mapping_method": 0, 12 | "mapping_optimized": true, 13 | "only_peupdate": false, 14 | "partition_optimized": false, 15 | "pipeline_method": 0, 16 | "prepare_mode": true, 17 | "search_iters": 100, 18 | "specification_optimized": true, 19 | "target": 0.01, 20 | "training_finish": false, 21 | "user_defined_area": 50000000 22 | } -------------------------------------------------------------------------------- /Parameters/SpecParam.json: -------------------------------------------------------------------------------- 1 | { 2 | "Subarray": [ 3 | 1024, 4 | 1024 5 | ], 6 | "Tile": [ 7 | 2, 8 | 2 9 | ], 10 | "parallism": 256, 11 | "buffersizeTile": 64, 12 | "ColumnMUX": 4, 13 | "MeshNoC_flitband": 64, 14 | "HtreeNoC_flitband": 128, 15 | "SFU_num": 16, 16 | "buswidthTile": 128 17 | } -------------------------------------------------------------------------------- /Parameters/SpecboundParam.json: -------------------------------------------------------------------------------- 1 | { 2 | "minSubarray": 64, 3 | "minMacronumbers": 2, 4 | "minbuswidthTile": 16, 5 | "minbuffersizeTile": 4, 6 | "minColumnMUX": 1, 7 | "minmeshflitband": 8, 8 | "minhtreeflitband": 4, 9 | "maxSubarray": 1024, 10 | "maxMacronumbers": 16, 11 | "maxbuswidthTile": 128, 12 | "maxbuffersizeTile": 128, 13 | "maxColumnMUX": 16, 14 | "maxmeshflitband": 128, 15 | "maxhtreeflitband": 128 16 | } -------------------------------------------------------------------------------- /Parameters/TechnodeParam.json: -------------------------------------------------------------------------------- 1 | {"featuresize": 32} -------------------------------------------------------------------------------- /Parameters/duplication.txt: -------------------------------------------------------------------------------- 1 | 1 1 1 1 1 1 1 1 1 1 1 -------------------------------------------------------------------------------- /Parameters/epoch.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/Parameters/epoch.json -------------------------------------------------------------------------------- /Parameters/layer.txt: -------------------------------------------------------------------------------- 1 | 8 2 | 11 3 | -------------------------------------------------------------------------------- /Parameters/layerconnect.txt: -------------------------------------------------------------------------------- 1 | prelayer: 1 nextlayer: 2 type: conv3*3 volumn: 16384 prelayer_tile: 0 0 nextlayer_tile: 0 0 2 | prelayer: 2 nextlayer: 3 type: conv3*3 volumn: 8192 prelayer_tile: 0 0 nextlayer_tile: 0 0 3 | prelayer: 3 nextlayer: 4 type: conv3*3 volumn: 16384 prelayer_tile: 0 0 nextlayer_tile: 0 0 4 | -------------------------------------------------------------------------------- /Parameters/mapping.txt: -------------------------------------------------------------------------------- 1 | layer: 1 Split_tile[0]: 1 Split_tile[1]: 1 Split_array[0]: 0.0263671875 Split_array[1]: 0.5 intraTile: 1 interTile: 1 duplication: 1 2 | layer: 2 Split_tile[0]: 1 Split_tile[1]: 1 Split_array[0]: 0.5625 Split_array[1]: 1 intraTile: 1 interTile: 1 duplication: 1 3 | layer: 3 Split_tile[0]: 1 Split_tile[1]: 1 Split_array[0]: 0.75 Split_array[1]: 3 intraTile: 1 interTile: 1 duplication: 1 4 | layer: 4 Split_tile[0]: 1 Split_tile[1]: 1 Split_array[0]: 1.5 Split_array[1]: 3 intraTile: 1 interTile: 1 duplication: 1 5 | layer: 5 Split_tile[0]: 1 Split_tile[1]: 1 Split_array[0]: 3 Split_array[1]: 3 intraTile: 1 interTile: 1 duplication: 1 6 | layer: 6 Split_tile[0]: 1 Split_tile[1]: 2 Split_array[0]: 3 Split_array[1]: 3 intraTile: 1 interTile: 2 duplication: 1 7 | layer: 7 Split_tile[0]: 1 Split_tile[1]: 2 Split_array[0]: 3 Split_array[1]: 3 intraTile: 1 interTile: 2 duplication: 1 8 | layer: 8 Split_tile[0]: 1 Split_tile[1]: 2 Split_array[0]: 3 Split_array[1]: 3 intraTile: 1 interTile: 2 duplication: 1 9 | layer: 9 Split_tile[0]: 1 Split_tile[1]: 1 Split_array[0]: 0.5 Split_array[1]: 0.5 intraTile: 1 interTile: 1 duplication: 1 10 | layer: 10 Split_tile[0]: 1 Split_tile[1]: 1 Split_array[0]: 0.5 Split_array[1]: 0.5 intraTile: 1 interTile: 1 duplication: 1 11 | layer: 11 Split_tile[0]: 1 Split_tile[1]: 1 Split_array[0]: 0.5 Split_array[1]: 0.009765625 intraTile: 1 interTile: 1 duplication: 1 12 | -------------------------------------------------------------------------------- /Parameters/meshconnect.txt: -------------------------------------------------------------------------------- 1 | prelayer: 1 nextlayer: 2 type: conv3*3 volumn: 16384 prelayer_tile: 0 0 nextlayer_tile: 1 1 2 | prelayer: 2 nextlayer: 3 type: conv3*3 volumn: 8192 prelayer_tile: 1 1 nextlayer_tile: 2 2 3 | prelayer: 3 nextlayer: 4 type: conv3*3 volumn: 16384 prelayer_tile: 2 2 nextlayer_tile: 3 3 4 | prelayer: 4 nextlayer: 5 type: conv3*3 volumn: 4096 prelayer_tile: 3 3 nextlayer_tile: 4 4 5 | prelayer: 5 nextlayer: 6 type: conv3*3 volumn: 8192 prelayer_tile: 4 4 nextlayer_tile: 5 6 6 | prelayer: 6 nextlayer: 7 type: conv3*3 volumn: 2048 prelayer_tile: 5 6 nextlayer_tile: 7 8 7 | prelayer: 7 nextlayer: 8 type: conv3*3 volumn: 2048 prelayer_tile: 7 8 nextlayer_tile: 9 10 8 | prelayer: 8 nextlayer: 9 type: fc volumn: 512 prelayer_tile: 9 10 nextlayer_tile: 11 11 9 | prelayer: 9 nextlayer: 10 type: fc volumn: 512 prelayer_tile: 11 11 nextlayer_tile: 12 12 10 | prelayer: 10 nextlayer: 11 type: fc volumn: 512 prelayer_tile: 12 12 nextlayer_tile: 13 13 11 | -------------------------------------------------------------------------------- /Parameters/prepare.txt: -------------------------------------------------------------------------------- 1 | layer: 1 array_size: 13824 compute_cycle: 1024 2 | layer: 2 array_size: 589824 compute_cycle: 256 3 | layer: 3 array_size: 2359296 compute_cycle: 64 4 | -------------------------------------------------------------------------------- /Parameters/tileNum.txt: -------------------------------------------------------------------------------- 1 | 14 -------------------------------------------------------------------------------- /Parameters/traffic.txt: -------------------------------------------------------------------------------- 1 | 0 1 131072 2 | 1 2 65536 3 | 2 3 131072 4 | 3 4 32768 5 | 4 5 65536 6 | 5 6 65536 7 | 5 7 8192 8 | 6 7 8192 9 | 7 8 16384 10 | 7 9 8192 11 | 8 9 8192 12 | 9 10 16384 13 | 9 11 2048 14 | 10 11 2048 15 | 11 12 4096 16 | 12 13 4096 17 | -------------------------------------------------------------------------------- /Parameters/trainParam.json: -------------------------------------------------------------------------------- 1 | { 2 | "quantization": true, 3 | "retrain": true, 4 | "resume": true, 5 | "nonlinear": false, 6 | "correction": false, 7 | "variation": false, 8 | "defect": false, 9 | "irdrop": false, 10 | "epoch": 100, 11 | "learning_rate": 0.002, 12 | "test_mode": false, 13 | "usermodel": false, 14 | "defaultmodel": true, 15 | "lenet": false, 16 | "vgg11": true, 17 | "vgg13": false, 18 | "vgg16": false, 19 | "vgg19": false, 20 | "resnet18": false, 21 | "resnet34": false, 22 | "resnet50": false, 23 | "resnet101": false, 24 | "resnet152": false, 25 | "mobilenet": false, 26 | "stgcn": false, 27 | "dependTaskId": "" 28 | } -------------------------------------------------------------------------------- /Performance/HtreePerf.json: -------------------------------------------------------------------------------- 1 | { 2 | "area": 0.009728169656804732, 3 | "energy": 8.267015384615383e-14, 4 | "latency": 6.059171597633137e-11 5 | } 6 | -------------------------------------------------------------------------------- /Performance/MacroPerf.json: -------------------------------------------------------------------------------- 1 | { 2 | "area": 0.06080014894395663, 3 | "energy": 5.022737131177685e-09, 4 | "latency": 2.6490491603111194e-06 5 | } 6 | -------------------------------------------------------------------------------- /Performance/MaxPoolPerf.json: -------------------------------------------------------------------------------- 1 | { 2 | "area": 2.0919091200000003e-05, 3 | "energy": 1.344002243749649e-14, 4 | "latency": 3.797158485041128e-10 5 | } 6 | -------------------------------------------------------------------------------- /Performance/MeshPerf.json: -------------------------------------------------------------------------------- 1 | { 2 | "area": 0.009728169656804732, 3 | "energy": 8.267015384615383e-14, 4 | "latency": 6.059171597633137e-11 5 | } 6 | -------------------------------------------------------------------------------- /Performance/ReluPerf.json: -------------------------------------------------------------------------------- 1 | { 2 | "area": 2.6148864000000004e-06, 3 | "energy": 2.7221313643479367e-15, 4 | "latency": 5e-10 5 | } 6 | -------------------------------------------------------------------------------- /Performance/SFU_performance.txt: -------------------------------------------------------------------------------- 1 | layer: 1 SFU_energy: 1.427180808751251e-09 SFU_latency: 2.048e-06 SFU_area: 0.0003347054592 SFU_mode: RELU 2 | layer: 1 SFU_energy: 7.04644248371016e-09 SFU_latency: 1.555316115472846e-06 SFU_area: 0.0026776436736 SFU_mode: MAXPOOL 3 | layer: 2 SFU_energy: 7.135904043756255e-10 SFU_latency: 1.024e-06 SFU_area: 0.0003347054592 SFU_mode: RELU 4 | layer: 2 SFU_energy: 3.52322124185508e-09 SFU_latency: 7.77658057736423e-07 SFU_area: 0.0026776436736 SFU_mode: MAXPOOL 5 | layer: 3 SFU_energy: 3.567952021878128e-10 SFU_latency: 5.12e-07 SFU_area: 0.0003347054592 SFU_mode: RELU 6 | layer: 4 SFU_energy: 3.567952021878128e-10 SFU_latency: 5.12e-07 SFU_area: 0.0003347054592 SFU_mode: RELU 7 | layer: 4 SFU_energy: 1.76161062092754e-09 SFU_latency: 3.888290288682115e-07 SFU_area: 0.0026776436736 SFU_mode: MAXPOOL 8 | layer: 5 SFU_energy: 1.783976010939064e-10 SFU_latency: 2.56e-07 SFU_area: 0.0003347054592 SFU_mode: RELU 9 | layer: 6 SFU_energy: 1.783976010939064e-10 SFU_latency: 1.28e-07 SFU_area: 0.0006694109184000001 SFU_mode: RELU 10 | layer: 6 SFU_energy: 8.8080531046377e-10 SFU_latency: 9.720725721705288e-08 SFU_area: 0.005355287347200001 SFU_mode: MAXPOOL 11 | layer: 7 SFU_energy: 4.45994002734766e-11 SFU_latency: 3.2e-08 SFU_area: 0.0006694109184000001 SFU_mode: RELU 12 | layer: 8 SFU_energy: 4.45994002734766e-11 SFU_latency: 3.2e-08 SFU_area: 0.0006694109184000001 SFU_mode: RELU 13 | layer: 8 SFU_energy: 2.202013276159425e-10 SFU_latency: 2.430181430426322e-08 SFU_area: 0.005355287347200001 SFU_mode: MAXPOOL 14 | layer: 9 SFU_energy: 1.114985006836915e-11 SFU_latency: 1.6e-08 SFU_area: 0.0003347054592 SFU_mode: RELU 15 | layer: 10 SFU_energy: 1.114985006836915e-11 SFU_latency: 1.6e-08 SFU_area: 0.0003347054592 SFU_mode: RELU 16 | -------------------------------------------------------------------------------- /Performance/SPMPerf.json: -------------------------------------------------------------------------------- 1 | { 2 | "area": 0.16186435702479338, 3 | "latency": 5.476280991735538e-12, 4 | "read_energy": 1.0493761363636364e-13, 5 | "write_energy": 1.1470681818181818e-13 6 | } 7 | -------------------------------------------------------------------------------- /Performance/SigmoidPerf.json: -------------------------------------------------------------------------------- 1 | { 2 | "area": 3.404267520000001e-05, 3 | "energy": 1.5025191568711023e-14, 4 | "latency": 2.236313600709814e-09 5 | } 6 | -------------------------------------------------------------------------------- /Performance/performance.txt: -------------------------------------------------------------------------------- 1 | layer: 1 energy: 9.290212086627788e-07 latency: 0.005524111503228209 area: 1.082641501982088 2 | layer: 2 energy: 9.495677503895688e-07 latency: 0.001429669960509808 area: 1.082641501982088 3 | layer: 3 energy: 7.731158512707131e-07 latency: 0.0003598773780714485 area: 1.082641501982088 4 | layer: 4 energy: 9.923482748409608e-07 latency: 0.0003629034776460655 area: 1.082641501982088 5 | layer: 5 energy: 4.678251085203962e-07 latency: 9.072586941151638e-05 area: 1.082641501982088 6 | layer: 6 energy: 1.04048046401855e-06 latency: 9.072586941151638e-05 area: 2.165283003964176 7 | layer: 7 energy: 2.601201132480037e-07 latency: 2.26814673528791e-05 area: 2.165283003964176 8 | layer: 8 energy: 2.60120107269354e-07 latency: 2.26814673528791e-05 area: 2.165283003964176 9 | layer: 9 energy: 3.590805611747458e-09 latency: 5.482382206757697e-06 area: 1.082641501982088 10 | layer: 10 energy: 3.590805703443544e-09 latency: 5.482382206757697e-06 area: 1.082641501982088 11 | layer: 11 energy: 1.89227732855944e-09 latency: 5.393465709832078e-06 area: 1.082641501982088 12 | 13 | total energy: 5.794086991587483e-06 total latency: 0.005526175984174955 total area: 15.3162700796293 14 | -------------------------------------------------------------------------------- /Weight/readme.md: -------------------------------------------------------------------------------- 1 | Training weights will be generated here. -------------------------------------------------------------------------------- /cacti-master/-rwx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/cacti-master/-rwx -------------------------------------------------------------------------------- /cacti-master/bufferInfo.txt: -------------------------------------------------------------------------------- 1 | latency: 0.331315 2 | read_energy: 0.00923451 3 | write_energy: 0.0100942 4 | area: 0.0765062 5 | -------------------------------------------------------------------------------- /cacti-master/cache.cfg.out: -------------------------------------------------------------------------------- 1 | Tech node (nm), Capacity (bytes), Number of banks, Associativity, Output width (bits), Access time (ns), Random cycle time (ns), Dynamic search energy (nJ), Dynamic read energy (nJ), Dynamic write energy (nJ), Standby leakage per bank(mW), Area (mm2), Ndwl, Ndbl, Nspd, Ndcm, Ndsam_level_1, Ndsam_level_2, Data arrary area efficiency %, Ntwl, Ntbl, Ntspd, Ntcm, Ntsam_level_1, Ntsam_level_2, Tag arrary area efficiency %, 2 | 90, 131072, 1, 2, 512, 1.47098, 1.86851, N/A, 0.303592, 0.615022, 63.7023, 2.24949, 2, 2, 1, 2, 2, 1, 78.3192, 2, 2, 4, 1, 8, 1, 77.9289, 3 | 90, 131072, 1, 2, 512, 1.47098, 1.86851, N/A, 0.303592, 0.615022, 63.7023, 2.24949, 2, 2, 1, 2, 2, 1, 78.3192, 2, 2, 4, 1, 8, 1, 77.9289, 4 | 90, 131072, 1, 2, 512, 1.47098, 1.86851, N/A, 0.303592, 0.615022, 63.7023, 2.24949, 2, 2, 1, 2, 2, 1, 78.3192, 2, 2, 4, 1, 8, 1, 77.9289, 5 | 90, 131072, 1, 2, 512, 1.47098, 1.86851, N/A, 0.303592, 0.615022, 63.7023, 2.24949, 2, 2, 1, 2, 2, 1, 78.3192, 2, 2, 4, 1, 8, 1, 77.9289, 6 | 90, 131072, 1, 2, 512, 1.47098, 1.86851, N/A, 0.303592, 0.615022, 63.7023, 2.24949, 2, 2, 1, 2, 2, 1, 78.3192, 2, 2, 4, 1, 8, 1, 77.9289, 7 | 90, 131072, 1, 2, 512, 1.47098, 1.86851, N/A, 0.303592, 0.615022, 63.7023, 2.24949, 2, 2, 1, 2, 2, 1, 78.3192, 2, 2, 4, 1, 8, 1, 77.9289, 8 | 90, 131072, 1, 2, 512, 1.47098, 1.86851, N/A, 0.303592, 0.615022, 63.7023, 2.24949, 2, 2, 1, 2, 2, 1, 78.3192, 2, 2, 4, 1, 8, 1, 77.9289, 9 | 22, 131072, 1, 1, 512, 0.43105, 0.512839, N/A, 0.0335769, 0.0441676, 12.0514, 0.199414, 2, 4, 2, 4, 1, 1, 49.5418, 2, 2, 8, 1, 16, 1, 77.3137, 10 | 22, 131072, 1, 1, 512, 0.43105, 0.512839, N/A, 0.0335769, 0.0441676, 12.0514, 0.199414, 2, 4, 2, 4, 1, 1, 49.5418, 2, 2, 8, 1, 16, 1, 77.3137, 11 | 22, 131072, 1, 1, 512, 0.43105, 0.512839, N/A, 0.0335769, 0.0441676, 12.0514, 0.199414, 2, 4, 2, 4, 1, 1, 49.5418, 2, 2, 8, 1, 16, 1, 77.3137, 12 | 22, 131072, 1, 1, 512, 0.43105, 0.512839, N/A, 0.0335769, 0.0441676, 12.0514, 0.199414, 2, 4, 2, 4, 1, 1, 49.5418, 2, 2, 8, 1, 16, 1, 77.3137, 13 | -------------------------------------------------------------------------------- /cacti-master/cacti.i: -------------------------------------------------------------------------------- 1 | %module cacti 2 | %{ 3 | /* Includes the header in the wrapper code */ 4 | #include "cacti_interface.h" 5 | %} 6 | 7 | /* Parse the header file to generate wrappers */ 8 | %include "cacti_interface.h" -------------------------------------------------------------------------------- /cacti-master/cacti.mk: -------------------------------------------------------------------------------- 1 | TARGET = cacti 2 | SHELL = /bin/sh 3 | .PHONY: all depend clean 4 | .SUFFIXES: .cc .o 5 | 6 | ifndef NTHREADS 7 | NTHREADS = 8 8 | endif 9 | 10 | 11 | LIBS = 12 | INCS = -lm 13 | 14 | ifeq ($(TAG),dbg) 15 | DBG = -Wall 16 | OPT = -ggdb -g -O0 -DNTHREADS=1 -gstabs+ 17 | else 18 | DBG = 19 | OPT = -g -msse2 -mfpmath=sse -DNTHREADS=$(NTHREADS) 20 | endif 21 | 22 | #CXXFLAGS = -Wall -Wno-unknown-pragmas -Winline $(DBG) $(OPT) 23 | CXXFLAGS = -Wno-unknown-pragmas $(DBG) $(OPT) 24 | CXX = g++ -m64 25 | CC = gcc -m64 26 | 27 | SRCS = area.cc bank.cc mat.cc main.cc Ucache.cc io.cc technology.cc basic_circuit.cc parameter.cc \ 28 | decoder.cc component.cc uca.cc subarray.cc wire.cc htree2.cc extio.cc extio_technology.cc \ 29 | cacti_interface.cc router.cc nuca.cc crossbar.cc arbiter.cc powergating.cc TSV.cc memorybus.cc \ 30 | memcad.cc memcad_parameters.cc 31 | 32 | 33 | OBJS = $(patsubst %.cc,obj_$(TAG)/%.o,$(SRCS)) 34 | PYTHONLIB_SRCS = $(patsubst main.cc, ,$(SRCS)) obj_$(TAG)/cacti_wrap.cc 35 | PYTHONLIB_OBJS = $(patsubst %.cc,%.o,$(PYTHONLIB_SRCS)) 36 | INCLUDES = -I /usr/include/python2.4 -I /usr/lib/python2.4/config 37 | 38 | all: obj_$(TAG)/$(TARGET) 39 | cp -f obj_$(TAG)/$(TARGET) $(TARGET) 40 | 41 | obj_$(TAG)/$(TARGET) : $(OBJS) 42 | $(CXX) $(OBJS) -o $@ $(INCS) $(CXXFLAGS) $(LIBS) -pthread -no-pie 43 | 44 | #obj_$(TAG)/%.o : %.cc 45 | # $(CXX) -c $(CXXFLAGS) $(INCS) -o $@ $< 46 | 47 | obj_$(TAG)/%.o : %.cc 48 | $(CXX) $(CXXFLAGS) -c $< -o $@ 49 | 50 | clean: 51 | -rm -f *.o _cacti.so cacti.py $(TARGET) 52 | 53 | 54 | -------------------------------------------------------------------------------- /cacti-master/extio.h: -------------------------------------------------------------------------------- 1 | #ifndef _extio_H_ 2 | #define _extio_H_ 3 | #include "parameter.h" 4 | #include "component.h" 5 | #include "extio_technology.h" 6 | 7 | class Extio : public Component 8 | { 9 | public: 10 | 11 | Extio(IOTechParam *); 12 | 13 | void extio_area(); 14 | void extio_eye(); 15 | void extio_power_dynamic(); 16 | void extio_power_phy(); 17 | void extio_power_term(); 18 | 19 | private: 20 | IOTechParam *io_param; 21 | 22 | double io_area; 23 | 24 | double io_power_term; 25 | double power_termination_write; 26 | double power_termination_read; 27 | double power_bias; 28 | double power_clk_bias; 29 | 30 | double phy_power; 31 | double phy_wtime; 32 | double phy_static_power; 33 | double phy_dynamic_power; 34 | 35 | double io_power_dynamic; 36 | 37 | double power_dq_write, power_dqs_write, power_ca_write, 38 | power_dq_read, power_dqs_read, power_ca_read, 39 | power_clk; 40 | 41 | double io_tmargin, io_vmargin; 42 | 43 | }; 44 | 45 | 46 | #endif // _extio_H_ 47 | -------------------------------------------------------------------------------- /cacti-master/makefile: -------------------------------------------------------------------------------- 1 | TAR = cacti 2 | 3 | .PHONY: dbg opt depend clean clean_dbg clean_opt 4 | 5 | all: dbg 6 | 7 | dbg: $(TAR).mk obj_dbg 8 | @$(MAKE) TAG=dbg -C . -f $(TAR).mk 9 | 10 | opt: $(TAR).mk obj_opt 11 | @$(MAKE) TAG=opt -C . -f $(TAR).mk 12 | 13 | obj_dbg: 14 | mkdir $@ 15 | 16 | obj_opt: 17 | mkdir $@ 18 | 19 | clean: clean_dbg clean_opt 20 | 21 | clean_dbg: obj_dbg 22 | @$(MAKE) TAG=dbg -C . -f $(TAR).mk clean 23 | rm -rf $< 24 | 25 | clean_opt: obj_opt 26 | @$(MAKE) TAG=opt -C . -f $(TAR).mk clean 27 | rm -rf $< 28 | 29 | -------------------------------------------------------------------------------- /cacti-master/memcad.h: -------------------------------------------------------------------------------- 1 | #ifndef __MEMCAD_H__ 2 | #define __MEMCAD_H__ 3 | 4 | #include "memcad_parameters.h" 5 | #include 6 | 7 | 8 | extern vector *memcad_all_channels; 9 | 10 | extern vector *memcad_all_bobs; 11 | 12 | extern vector *memcad_all_memories; 13 | 14 | extern vector *memcad_best_results; 15 | 16 | 17 | 18 | void find_all_channels(MemCadParameters * memcad_params); 19 | 20 | void find_all_bobs(MemCadParameters * memcad_params); 21 | 22 | bool find_all_memories(MemCadParameters * memcad_params); 23 | 24 | void clean_results(); 25 | 26 | void solve_memcad(MemCadParameters * memcad_params); 27 | 28 | #endif 29 | 30 | 31 | -------------------------------------------------------------------------------- /cacti-master/performance.txt: -------------------------------------------------------------------------------- 1 | Data array: Total dynamic read energy/access (nJ): 0.286158 2 | -------------------------------------------------------------------------------- /cacti-master/regression.test: -------------------------------------------------------------------------------- 1 | cache 4 types 2 | ./cacti -infile test_configs/cache1.cfg #L1 2-way 32K 3 | ./cacti -infile test_configs/cache2.cfg #L2 4-way 256K 4 | ./cacti -infile test_configs/cache3.cfg #L3 8-way 16M 5 | ./cacti -infile test_configs/cache4.cfg #L1 full-asso 4K with single search port 6 | RAM 4 types 7 | ./cacti -infile test_configs/ram1.cfg # 16M 8 | ./cacti -infile test_configs/ram2.cfg # itrs-hp itrs-lstp 9 | ./cacti -infile test_configs/ram3.cfg # two banks no-ecc 128M 10 | ./cacti -infile test_configs/ram4.cfg # 32K 2-way 11 | CAM 4 types 12 | ./cacti -infile test_configs/cam1.cfg # same as ram1 but ram->cam and full-asso 13 | ./cacti -infile test_configs/cam2.cfg # same as cam1 with line size = 128 14 | ./cacti -infile test_configs/cam3.cfg # cam1 for 40nm technology 15 | ./cacti -infile test_configs/cam4.cfg # ca1 with exclusive read and write port 16 | NUCA 4 types 17 | ./cacti -infile test_configs/nuca1.cfg # 18 | ./cacti -infile test_configs/nuca2.cfg 19 | ./cacti -infile test_configs/nuca3.cfg 20 | ./cacti -infile test_configs/nuca3.cfg 21 | eDRAM 4 types 22 | ./cacti -infile test_configs/edram1.cfg # 23 | ./cacti -infile test_configs/edram2.cfg 24 | ./cacti -infile test_configs/edram3.cfg 25 | ./cacti -infile test_configs/edram4.cfg 26 | DRAM 4 types 27 | ./cacti -infile test_configs/dram1.cfg # 28 | ./cacti -infile test_configs/dram2.cfg 29 | ./cacti -infile test_configs/dram3.cfg 30 | ./cacti -infile test_configs/dram4.cfg 31 | IO 4 different parameters 32 | ./cacti -infile test_configs/io1.cfg # 33 | ./cacti -infile test_configs/io2.cfg 34 | ./cacti -infile test_configs/io3.cfg 35 | ./cacti -infile test_configs/io4.cfg 36 | Power gating 4 types 37 | ./cacti -infile test_configs/power_gate1.cfg 38 | ./cacti -infile test_configs/power_gate2.cfg 39 | ./cacti -infile test_configs/power_gate3.cfg 40 | ./cacti -infile test_configs/power_gate4.cfg 41 | 3D 4 types 42 | ./cacti -infile test_configs/3D1.cfg 43 | ./cacti -infile test_configs/3D2.cfg 44 | ./cacti -infile test_configs/3D3.cfg 45 | ./cacti -infile test_configs/3D4.cfg -------------------------------------------------------------------------------- /cacti-master/tech_params/16nm.dat: -------------------------------------------------------------------------------- 1 | Invalid technology nodes 2 | -------------------------------------------------------------------------------- /datasets/readme.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /defect/Vgg_l1.pth: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/defect/Vgg_l1.pth -------------------------------------------------------------------------------- /defect/Vgg_l10.pth: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/defect/Vgg_l10.pth -------------------------------------------------------------------------------- /defect/Vgg_l11.pth: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/defect/Vgg_l11.pth -------------------------------------------------------------------------------- /defect/Vgg_l2.pth: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/defect/Vgg_l2.pth -------------------------------------------------------------------------------- /defect/Vgg_l3.pth: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/defect/Vgg_l3.pth -------------------------------------------------------------------------------- /defect/Vgg_l4.pth: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/defect/Vgg_l4.pth -------------------------------------------------------------------------------- /defect/Vgg_l5.pth: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/defect/Vgg_l5.pth -------------------------------------------------------------------------------- /defect/Vgg_l6.pth: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/defect/Vgg_l6.pth -------------------------------------------------------------------------------- /defect/Vgg_l7.pth: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/defect/Vgg_l7.pth -------------------------------------------------------------------------------- /defect/Vgg_l8.pth: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/defect/Vgg_l8.pth -------------------------------------------------------------------------------- /defect/Vgg_l9.pth: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/defect/Vgg_l9.pth -------------------------------------------------------------------------------- /docs/manual.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/docs/manual.pdf -------------------------------------------------------------------------------- /generate_data/tcad/accuracy_out/accuracy_out1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/generate_data/tcad/accuracy_out/accuracy_out1.txt -------------------------------------------------------------------------------- /generate_data/tcad/circuit_out/circuit_out1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/generate_data/tcad/circuit_out/circuit_out1.txt -------------------------------------------------------------------------------- /generate_data/tcad/mapping_out/mapping_out1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/generate_data/tcad/mapping_out/mapping_out1.txt -------------------------------------------------------------------------------- /generate_data/tcad/performance_out/performance_out1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/generate_data/tcad/performance_out/performance_out1.txt -------------------------------------------------------------------------------- /generate_data/tcad/readme.md: -------------------------------------------------------------------------------- 1 | Files generated from Accuracy_optimizer.py, Mapping_optimizer.py, Specification_optimizer.py and Circuit_optimizer.py will be stored in this directory. -------------------------------------------------------------------------------- /src/Bayesian/.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | branch = True 3 | source = bayes_opt 4 | 5 | [report] 6 | exclude_lines = 7 | pragma: no cover 8 | .* # pragma: no cover 9 | .* # nocover 10 | def __repr__ 11 | raise AssertionError 12 | raise NotImplementedError 13 | if 0: 14 | verbose = .* 15 | raise 16 | pass 17 | if __name__ == .__main__.: 18 | print(.*) 19 | 20 | omit = 21 | */setup.py 22 | examples/* 23 | tests/* 24 | bayes_opt/logger.py 25 | -------------------------------------------------------------------------------- /src/Bayesian/.gitignore: -------------------------------------------------------------------------------- 1 | .ipynb_checkpoints 2 | *.pyc 3 | *.egg-info/ 4 | build/ 5 | dist/ 6 | scratch/ 7 | .idea/ 8 | .DS_Store 9 | bo_eg*.png 10 | gif/ 11 | 12 | # Unit test / coverage reports 13 | htmlcov/ 14 | .tox/ 15 | .coverage 16 | .coverage.* 17 | .cache 18 | nosetests.xml 19 | coverage.xml 20 | *,cover 21 | .hypothesis/ 22 | 23 | # Environments 24 | .env 25 | .venv 26 | env/ 27 | venv/ 28 | ENV/ 29 | env.bak/ 30 | venv.bak/ -------------------------------------------------------------------------------- /src/Bayesian/.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | sudo: false 3 | 4 | cache: 5 | apt: true 6 | directories: 7 | - $HOME/.cache/pip 8 | - $HOME/download 9 | python: 10 | - "2.7" 11 | - "3.4" 12 | - "3.5" 13 | - "3.6" 14 | before_install: 15 | - pip install pip -U 16 | - pip install pytest -U 17 | - pip install pytest-cov -U 18 | - pip install codecov -U 19 | #- pip install xdoctest -U 20 | install: 21 | #- travis_retry python setup.py build develop 22 | - travis_retry pip install -e . 23 | script: 24 | - travis_wait pytest --cov-config .coveragerc --cov-report html --cov=bayes_opt 25 | #-p no:doctest --xdoctest 26 | after_success: 27 | #- coveralls || echo "Coveralls upload failed" 28 | - codecov 29 | cache: 30 | apt: true 31 | directories: 32 | - $HOME/.pip-cache 33 | -------------------------------------------------------------------------------- /src/Bayesian/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Fernando M. F. Nogueira 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /src/Bayesian/bayes/__init__.py: -------------------------------------------------------------------------------- 1 | from .bayesian_optimization import BayesianOptimization, Events 2 | from .domain_reduction import SequentialDomainReductionTransformer 3 | from .util import UtilityFunction 4 | from .logger import ScreenLogger, JSONLogger 5 | 6 | __all__ = [ 7 | "BayesianOptimization", 8 | "UtilityFunction", 9 | "Events", 10 | "ScreenLogger", 11 | "JSONLogger", 12 | "SequentialDomainReductionTransformer", 13 | ] 14 | -------------------------------------------------------------------------------- /src/Bayesian/bayes/event.py: -------------------------------------------------------------------------------- 1 | class Events: 2 | OPTIMIZATION_START = 'optimization:start' 3 | OPTIMIZATION_STEP = 'optimization:step' 4 | OPTIMIZATION_END = 'optimization:end' 5 | 6 | 7 | DEFAULT_EVENTS = [ 8 | Events.OPTIMIZATION_START, 9 | Events.OPTIMIZATION_STEP, 10 | Events.OPTIMIZATION_END, 11 | ] 12 | -------------------------------------------------------------------------------- /src/Bayesian/bayes/observer.py: -------------------------------------------------------------------------------- 1 | """ 2 | observers... 3 | """ 4 | from datetime import datetime 5 | from .event import Events 6 | 7 | 8 | class Observer: 9 | def update(self, event, instance): 10 | raise NotImplementedError 11 | 12 | 13 | class _Tracker(object): 14 | def __init__(self): 15 | self._iterations = 0 16 | 17 | self._previous_max = None 18 | self._previous_max_params = None 19 | 20 | self._start_time = None 21 | self._previous_time = None 22 | 23 | def _update_tracker(self, event, instance): 24 | if event == Events.OPTIMIZATION_STEP: 25 | self._iterations += 1 26 | 27 | current_max = instance.max 28 | if (self._previous_max is None or 29 | current_max["target"] > self._previous_max): 30 | self._previous_max = current_max["target"] 31 | self._previous_max_params = current_max["params"] 32 | 33 | def _time_metrics(self): 34 | now = datetime.now() 35 | if self._start_time is None: 36 | self._start_time = now 37 | if self._previous_time is None: 38 | self._previous_time = now 39 | 40 | time_elapsed = now - self._start_time 41 | time_delta = now - self._previous_time 42 | 43 | self._previous_time = now 44 | return ( 45 | now.strftime("%Y-%m-%d %H:%M:%S"), 46 | time_elapsed.total_seconds(), 47 | time_delta.total_seconds() 48 | ) 49 | -------------------------------------------------------------------------------- /src/Bayesian/examples/bayesian_optimization.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/src/Bayesian/examples/bayesian_optimization.gif -------------------------------------------------------------------------------- /src/Bayesian/examples/bo_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/src/Bayesian/examples/bo_example.png -------------------------------------------------------------------------------- /src/Bayesian/examples/func.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/src/Bayesian/examples/func.png -------------------------------------------------------------------------------- /src/Bayesian/examples/sdr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/booniebears/CoMN/eca10e1d80cd51e79b90c76099ae25ee7b069b50/src/Bayesian/examples/sdr.png -------------------------------------------------------------------------------- /src/Bayesian/pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | ;addopts = -p no:doctest --xdoctest --xdoctest-style=google 3 | norecursedirs = .git ignore build __pycache__ 4 | 5 | filterwarnings= default 6 | -------------------------------------------------------------------------------- /src/Bayesian/setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description-file = README.md -------------------------------------------------------------------------------- /src/Bayesian/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, find_packages 2 | 3 | setup( 4 | name='bayesian-optimization', 5 | version='1.2.0', 6 | url='https://github.com/fmfn/BayesianOptimization', 7 | packages=find_packages(), 8 | author='Fernando Nogueira', 9 | author_email="fmfnogueira@gmail.com", 10 | description='Bayesian Optimization package', 11 | long_description='A Python implementation of global optimization with gaussian processes.', 12 | download_url='https://github.com/fmfn/BayesianOptimization/tarball/0.6', 13 | install_requires=[ 14 | "numpy >= 1.9.0", 15 | "scipy >= 0.14.0", 16 | "scikit-learn >= 0.18.0", 17 | ], 18 | classifiers=[ 19 | 'License :: OSI Approved :: MIT License', 20 | ] 21 | ) 22 | -------------------------------------------------------------------------------- /src/Bayesian/tests/test_acceptance.py: -------------------------------------------------------------------------------- 1 | # import numpy as np 2 | 3 | # from bayes_opt import BayesianOptimization 4 | # from bayes_opt.util import ensure_rng 5 | 6 | 7 | # def test_simple_optimization(): 8 | # """ 9 | # ... 10 | # """ 11 | # def f(x, y): 12 | # return -x ** 2 - (y - 1) ** 2 + 1 13 | 14 | 15 | # optimizer = BayesianOptimization( 16 | # f=f, 17 | # pbounds={"x": (-3, 3), "y": (-3, 3)}, 18 | # random_state=12356, 19 | # verbose=0, 20 | # ) 21 | 22 | # optimizer.maximize(init_points=0, n_iter=25) 23 | 24 | # max_target = optimizer.max["target"] 25 | # max_x = optimizer.max["params"]["x"] 26 | # max_y = optimizer.max["params"]["y"] 27 | 28 | # assert (1 - max_target) < 1e-3 29 | # assert np.abs(max_x - 0) < 1e-1 30 | # assert np.abs(max_y - 1) < 1e-1 31 | 32 | 33 | # def test_intermediate_optimization(): 34 | # """ 35 | # ... 36 | # """ 37 | # def f(x, y, z): 38 | # x_factor = np.exp(-(x - 2) ** 2) + (1 / (x ** 2 + 1)) 39 | # y_factor = np.exp(-(y - 6) ** 2 / 10) 40 | # z_factor = (1 + 0.2 * np.cos(z)) / (1 + z ** 2) 41 | # return (x_factor + y_factor) * z_factor 42 | 43 | # optimizer = BayesianOptimization( 44 | # f=f, 45 | # pbounds={"x": (-7, 7), "y": (-7, 7), "z": (-7, 7)}, 46 | # random_state=56, 47 | # verbose=0, 48 | # ) 49 | 50 | # optimizer.maximize(init_points=0, n_iter=150) 51 | 52 | # max_target = optimizer.max["target"] 53 | # max_x = optimizer.max["params"]["x"] 54 | # max_y = optimizer.max["params"]["y"] 55 | # max_z = optimizer.max["params"]["z"] 56 | 57 | # assert (2.640 - max_target) < 0 58 | # assert np.abs(2 - max_x) < 1e-1 59 | # assert np.abs(6 - max_y) < 1e-1 60 | # assert np.abs(0 - max_z) < 1e-1 61 | 62 | 63 | # if __name__ == '__main__': 64 | # r""" 65 | # CommandLine: 66 | # python tests/test_bayesian_optimization.py 67 | # """ 68 | # import pytest 69 | # pytest.main([__file__]) 70 | -------------------------------------------------------------------------------- /src/Bayesian/tests/test_logs.json: -------------------------------------------------------------------------------- 1 | {"datetime": {"delta": 0.0, "datetime": "2018-11-25 08:29:25", "elapsed": 0.0}, "params": {"y": 1.3219469606529488, "x": 2.8340440094051482}, "target": -7.135455292718879} 2 | {"datetime": {"delta": 0.001301, "datetime": "2018-11-25 08:29:25", "elapsed": 0.001301}, "params": {"y": -1.1860045642089614, "x": 2.0002287496346898}, "target": -7.779531005607566} 3 | {"datetime": {"delta": 1.075242, "datetime": "2018-11-25 08:29:26", "elapsed": 1.076543}, "params": {"y": 3.0, "x": 4.0}, "target": -19.0} 4 | {"datetime": {"delta": 0.239797, "datetime": "2018-11-25 08:29:26", "elapsed": 1.31634}, "params": {"y": -2.412527795983739, "x": 2.3776144540856503}, "target": -16.29839645063864} 5 | {"datetime": {"delta": 0.247293, "datetime": "2018-11-25 08:29:26", "elapsed": 1.563633}, "params": {"y": -0.005822117636089974, "x": 2.104665051994087}, "target": -4.441293113411222} 6 | -------------------------------------------------------------------------------- /src/Bayesian/tests/test_queue.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from bayes_opt.bayesian_optimization import Queue 3 | 4 | 5 | def test_add(): 6 | queue = Queue() 7 | 8 | assert len(queue) == 0 9 | assert queue.empty 10 | 11 | queue.add(1) 12 | assert len(queue) == 1 13 | 14 | queue.add(1) 15 | assert len(queue) == 2 16 | 17 | queue.add(2) 18 | assert len(queue) == 3 19 | 20 | 21 | def test_queue(): 22 | 23 | queue = Queue() 24 | 25 | with pytest.raises(StopIteration): 26 | next(queue) 27 | 28 | queue.add(1) 29 | queue.add(2) 30 | queue.add(3) 31 | 32 | assert len(queue) == 3 33 | assert not queue.empty 34 | 35 | assert next(queue) == 1 36 | assert len(queue) == 2 37 | 38 | assert next(queue) == 2 39 | assert next(queue) == 3 40 | assert len(queue) == 0 41 | 42 | 43 | 44 | if __name__ == '__main__': 45 | r""" 46 | CommandLine: 47 | python tests/test_observer.py 48 | """ 49 | pytest.main([__file__]) 50 | -------------------------------------------------------------------------------- /src/Bayesian/tests/test_seq_domain_red.py: -------------------------------------------------------------------------------- 1 | from bayes_opt import SequentialDomainReductionTransformer 2 | from bayes_opt import BayesianOptimization 3 | 4 | 5 | def black_box_function(x, y): 6 | """Function with unknown internals we wish to maximize. 7 | 8 | This is just serving as an example, for all intents and 9 | purposes think of the internals of this function, i.e.: the process 10 | which generates its output values, as unknown. 11 | """ 12 | return -x ** 2 - (y - 1) ** 2 + 1 13 | 14 | 15 | def test_bound_x_maximize(): 16 | 17 | class Tracker: 18 | def __init__(self): 19 | self.start_count = 0 20 | self.step_count = 0 21 | self.end_count = 0 22 | 23 | def update_start(self, event, instance): 24 | self.start_count += 1 25 | 26 | def update_step(self, event, instance): 27 | self.step_count += 1 28 | 29 | def update_end(self, event, instance): 30 | self.end_count += 1 31 | 32 | def reset(self): 33 | self.__init__() 34 | 35 | bounds_transformer = SequentialDomainReductionTransformer() 36 | pbounds = {'x': (-10, 10), 'y': (-10, 10)} 37 | n_iter = 10 38 | 39 | standard_optimizer = BayesianOptimization( 40 | f=black_box_function, 41 | pbounds=pbounds, 42 | verbose=2, 43 | random_state=1, 44 | ) 45 | 46 | standard_optimizer.maximize( 47 | init_points=2, 48 | n_iter=n_iter, 49 | ) 50 | 51 | mutated_optimizer = BayesianOptimization( 52 | f=black_box_function, 53 | pbounds=pbounds, 54 | verbose=2, 55 | random_state=1, 56 | bounds_transformer=bounds_transformer 57 | ) 58 | 59 | mutated_optimizer.maximize( 60 | init_points=2, 61 | n_iter=n_iter, 62 | ) 63 | 64 | assert len(standard_optimizer.space) == len(mutated_optimizer.space) 65 | assert not (standard_optimizer._space.bounds == 66 | mutated_optimizer._space.bounds).any() 67 | -------------------------------------------------------------------------------- /src/data_transmiss/PyActInput.txt: -------------------------------------------------------------------------------- 1 | shape: 1,256,8,8 2 | mode: 0 3 | -------------------------------------------------------------------------------- /src/data_transmiss/PyInput.txt: -------------------------------------------------------------------------------- 1 | shape: 1,128,8,8 2 | input_sparsity: 0.012154074385762215 3 | -------------------------------------------------------------------------------- /src/data_transmiss/PyParam.txt: -------------------------------------------------------------------------------- 1 | layer: 3 2 | stride: 1,1 3 | kernel_size: 3,3 4 | padding: 1,1 5 | w_precision: 8 6 | a_precision: 8 7 | -------------------------------------------------------------------------------- /src/data_transmiss/PyWeight.txt: -------------------------------------------------------------------------------- 1 | shape: 256,128,3,3 2 | weight_sparsity: 5.07351342093898e-06 3 | -------------------------------------------------------------------------------- /src/frozen_dir.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import sys 3 | import os 4 | 5 | def app_path(): 6 | """Returns the base application path.""" 7 | # if hasattr(sys, 'frozen'): 8 | # # Handles PyInstaller 9 | # return os.path.dirname(sys.executable) # 使用pyinstaller打包后的exe目录 10 | curdir = os.getcwd() 11 | return os.path.dirname(curdir) # upper level dir 12 | -------------------------------------------------------------------------------- /src/refactor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | project(CoMN_Refactor) 3 | 4 | set(CMAKE_CXX_STANDARD 17) 5 | 6 | # file(GLOB_RECURSE SOURCES 7 | # "*.cpp" 8 | # ) 9 | 10 | # file(GLOB_RECURSE DIR_SRC "src/*.cpp") 11 | 12 | # # list(FILTER SOURCES EXCLUDE REGEX "^.*build/.*$") 13 | 14 | # add_executable(main ${SOURCES}) 15 | 16 | # 编译当前目录下的所有.cpp文件 17 | file(GLOB SOURCES *.cpp) 18 | 19 | # 添加编译源文件 20 | add_executable(main ${SOURCES}) 21 | 22 | # 添加 ./CoMN_Sim/src 目录下的所有.cpp文件 23 | file(GLOB_RECURSE COMN_SIM_SOURCES ./CoMN_Sim/src/*.cpp) 24 | 25 | # 将 CoMN_Sim 源文件添加到可执行文件中 26 | target_sources(main PRIVATE ${COMN_SIM_SOURCES}) -------------------------------------------------------------------------------- /src/refactor/CoMN_Sim/.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | .vscode/ 3 | -------------------------------------------------------------------------------- /src/refactor/CoMN_Sim/include/Adder.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Adder.h 3 | * @author booniebears 4 | * @brief 5 | * @date 2023-10-22 6 | * 7 | * @copyright Copyright (c) 2023 8 | * 9 | */ 10 | #ifndef ADDER_H_ 11 | #define ADDER_H_ 12 | 13 | #include "../include/BasicUnit.h" 14 | #include "../include/general/MemCell.h" 15 | #include "../include/general/Param.h" 16 | #include "../include/general/Technology.h" 17 | 18 | namespace CoMN { 19 | class Adder : public BasicUnit { 20 | public: 21 | Adder(Param *_param, Technology *_technology); 22 | virtual ~Adder() {} 23 | void Initialize(int _numOfBits, int _numOfAdders); 24 | void CalculateArea(double _newHeight, double _newWidth, AreaModify _option); 25 | void CalculateLatency(double _rampInput, double _capLoad, double numRead); 26 | void CalculatePower(double numRead, int numAdderPerOperation); 27 | 28 | int numOfAdders; // record that so as to Calculate Area/Latency Later; 29 | int numOfBits; // num of bits of an Adder 30 | 31 | private: 32 | Param *param; 33 | Technology *tech; 34 | double widthNandN, widthNandP; // NMOS and PMOS of NAND 35 | double capNandInput, capNandOutput; 36 | }; 37 | } // namespace CoMN 38 | 39 | #endif -------------------------------------------------------------------------------- /src/refactor/CoMN_Sim/include/BasicUnit.h: -------------------------------------------------------------------------------- 1 | #ifndef BASICUNIT_H_ 2 | #define BASICUNIT_H_ 3 | 4 | using namespace std; 5 | namespace CoMN { 6 | class BasicUnit { 7 | public: 8 | BasicUnit(); 9 | virtual ~BasicUnit() {} 10 | 11 | /* Functions */ 12 | // virtual void PrintProperty(const char *str); 13 | // virtual void SaveOutput(const char *str); 14 | // virtual void MagicLayout(); 15 | // virtual void OverrideLayout(); 16 | 17 | /* Properties */ 18 | double height; /* Unit: m */ 19 | double width; /* Unit: m */ 20 | double area; /* Unit: m^2 */ 21 | double usedArea; /* Unit: m^2 */ 22 | double readLatency, writeLatency; /* Unit: s */ 23 | double readDynamicEnergy, writeDynamicEnergy; /* Unit: J */ 24 | double leakage; /* Unit: W */ 25 | }; 26 | } // namespace CoMN 27 | 28 | #endif -------------------------------------------------------------------------------- /src/refactor/CoMN_Sim/include/BitShifter.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file BitShifter.h 3 | * @author booniebears 4 | * @brief The implementation of ReLU unit. 5 | * @date 2023-11-07 6 | * 7 | * @copyright Copyright (c) 2023 8 | * 9 | */ 10 | #ifndef BITSHIFTER_H_ 11 | #define BITSHIFTER_H_ 12 | 13 | #include "../include/BasicUnit.h" 14 | #include "../include/DFF.h" 15 | #include "../include/general/MemCell.h" 16 | #include "../include/general/Param.h" 17 | #include "../include/general/Technology.h" 18 | 19 | namespace CoMN { 20 | class BitShifter : public BasicUnit { 21 | public: 22 | BitShifter(Param *_param, Technology *_technology); 23 | virtual ~BitShifter() {} 24 | void Initialize(int _numOfBits, int _numOfUnits); 25 | void CalculateArea(double _newHeight, double _newWidth, AreaModify _option); 26 | void CalculateLatency(double numRead); 27 | void CalculatePower(double numRead); 28 | 29 | int numOfBits; 30 | int numOfUnits; 31 | 32 | private: 33 | Param *param; 34 | Technology *tech; 35 | DFF dff; 36 | 37 | int numOfDFFs; 38 | }; 39 | } // namespace CoMN 40 | 41 | #endif // BITSHIFTER_H_ -------------------------------------------------------------------------------- /src/refactor/CoMN_Sim/include/Comparator.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Comparator.h 3 | * @author booniebears 4 | * @brief Pairwise Comparator. 5 | * @date 2023-12-26 6 | * 7 | * @copyright Copyright (c) 2023 8 | * 9 | */ 10 | 11 | #ifndef COMPARATOR_H_ 12 | #define COMPARATOR_H_ 13 | 14 | #include "../include/BasicUnit.h" 15 | #include "../include/general/MemCell.h" 16 | #include "../include/general/Param.h" 17 | #include "../include/general/Technology.h" 18 | 19 | namespace CoMN { 20 | 21 | class Comparator : public BasicUnit { 22 | public: 23 | Comparator(Param *_param, Technology *_technology); 24 | virtual ~Comparator() {} 25 | void Initialize(int _numOfBits, int _numOfUnits); 26 | void CalculateArea(double widthArray); 27 | void CalculateLatency(double _rampInput, double _capLoad, double numRead); 28 | void CalculatePower(double numRead); 29 | 30 | int numOfBits; 31 | int numOfUnits; 32 | double areaUnit; 33 | 34 | private: 35 | Param *param; 36 | Technology *tech; 37 | double widthInvN, widthInvP, widthNand2N, widthNand2P, widthNand3N, 38 | widthNand3P; 39 | double capInvInput, capInvOutput, capNand2Input, capNand2Output, 40 | capNand3Input, capNand3Output; 41 | }; 42 | 43 | } // namespace CoMN 44 | 45 | #endif // !COMPARATOR_H_ 46 | -------------------------------------------------------------------------------- /src/refactor/CoMN_Sim/include/CurrentSenseAmp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file CurrentSenseAmp.h 3 | * @author booniebears 4 | * @brief 5 | * @date 2023-10-20 6 | * 7 | * @copyright Copyright (c) 2023 8 | * 9 | */ 10 | #ifndef CURRENTSENSEAMP_H_ 11 | #define CURRENTSENSEAMP_H_ 12 | 13 | #include 14 | 15 | #include "../include/BasicUnit.h" 16 | #include "../include/general/MemCell.h" 17 | #include "../include/general/Param.h" 18 | #include "../include/general/Technology.h" 19 | 20 | namespace CoMN { 21 | class CurrentSenseAmp : public BasicUnit { 22 | public: 23 | CurrentSenseAmp(Param *_param, Technology *_technology); 24 | virtual ~CurrentSenseAmp() {} 25 | void Initialize(int _numOfColumns); 26 | void CalculateArea(double _newHeight, double _newWidth, AreaModify _option); 27 | void CalculateLatency(vector &colResistance, double numRead); 28 | void CalculatePower(vector &colResistance, double numRead); 29 | double GetColumnLatency(double resCol); 30 | double GetColumnPower(double resCol); 31 | 32 | int numOfColumns; 33 | 34 | private: 35 | Param *param; 36 | Technology *tech; 37 | double widthNMOS, widthPMOS; 38 | double Rref; 39 | }; 40 | } // namespace CoMN 41 | 42 | #endif -------------------------------------------------------------------------------- /src/refactor/CoMN_Sim/include/DFF.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file DFF.h 3 | * @author booniebears 4 | * @brief 5 | * @date 2023-10-22 6 | * 7 | * @copyright Copyright (c) 2023 8 | * 9 | */ 10 | #ifndef DFF_H_ 11 | #define DFF_H_ 12 | 13 | #include "../include/BasicUnit.h" 14 | #include "../include/general/MemCell.h" 15 | #include "../include/general/Param.h" 16 | #include "../include/general/Technology.h" 17 | 18 | namespace CoMN { 19 | class DFF : public BasicUnit { 20 | public: 21 | DFF(Param *_param, Technology *_technology); 22 | virtual ~DFF() {} 23 | void Initialize(int _numDFF); 24 | void CalculateArea(double _newHeight, double _newWidth, AreaModify _option); 25 | void CalculateLatency(double numRead); 26 | void CalculatePower(double numRead, int numDffPerOperation); 27 | double getCap() { return capTgDrain; } 28 | int numOfDFFs; 29 | 30 | private: 31 | Param *param; 32 | Technology *tech; 33 | 34 | // Transistor attributes 35 | double widthTgN, widthTgP, widthInvN, widthInvP; 36 | double capTgDrain, capTgGateN, capTgGateP, capInvInput, capInvOutput; 37 | }; 38 | } // namespace CoMN 39 | 40 | #endif -------------------------------------------------------------------------------- /src/refactor/CoMN_Sim/include/DecoderDriver.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file DecoderDriver.h 3 | * @author booniebears 4 | * @brief 5 | * @date 2023-10-19 6 | * 7 | * @copyright Copyright (c) 2023 8 | * 9 | */ 10 | #ifndef DECODERDRIVER_H_ 11 | #define DECODERDRIVER_H_ 12 | 13 | #include "../include/BasicUnit.h" 14 | #include "../include/general/MemCell.h" 15 | #include "../include/general/Param.h" 16 | #include "../include/general/Technology.h" 17 | 18 | namespace CoMN { 19 | class DecoderDriver : public BasicUnit { 20 | public: 21 | DecoderDriver(Param *_param, Technology *_technology); 22 | virtual ~DecoderDriver() {} 23 | void Initialize(RowColMode _mode, int _numOfRows, int _numOfColumns, 24 | double resMemCellOn); 25 | void CalculateArea(double _newHeight, double _newWidth, AreaModify _option); 26 | void CalculateLatency(double _rampInput, double _capLoad, double _resLoad, 27 | double numRead, double numWrite); 28 | void CalculatePower(int numReadCells, int numWriteCells, double numRead, 29 | double numWrite); 30 | 31 | RowColMode mode; 32 | int numOfRows; 33 | int numOfColumns; 34 | 35 | private: 36 | Param *param; 37 | Technology *tech; 38 | double widthInvN, widthInvP, widthTgN, widthTgP; 39 | double resTg; 40 | double capInvInput, capInvOutput, capTgDrain, capTgGateN, capTgGateP; 41 | }; 42 | } // namespace CoMN 43 | 44 | #endif -------------------------------------------------------------------------------- /src/refactor/CoMN_Sim/include/MaxPool.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file MaxPool.h 3 | * @author booniebears 4 | * @brief 5 | * @date 2023-12-26 6 | * 7 | * @copyright Copyright (c) 2023 8 | * 9 | */ 10 | 11 | #ifndef MAXPOOL_H_ 12 | #define MAXPOOL_H_ 13 | 14 | #include "../include/BasicUnit.h" 15 | #include "../include/Comparator.h" 16 | #include "../include/general/MemCell.h" 17 | #include "../include/general/Param.h" 18 | #include "../include/general/Technology.h" 19 | 20 | namespace CoMN { 21 | 22 | class MaxPool : public BasicUnit { 23 | public: 24 | MaxPool(Param *_param, Technology *_technology); 25 | virtual ~MaxPool() {} 26 | void Initialize(int _numOfBits, int _window, int _numOfUnits); 27 | void CalculateArea(double widthArray); 28 | void CalculateLatency(double _rampInput, double _capLoad, double numRead); 29 | void CalculatePower(double numRead); 30 | 31 | int numOfBits; 32 | int numOfUnits; 33 | 34 | private: 35 | Param *param; 36 | Technology *tech; 37 | Comparator comparator; 38 | int numOfComps = 0; // num of Comparators 39 | int numOfComStages = 0; // num of Compare stages 40 | 41 | double widthInvN, widthInvP, widthNandN, widthNandP, widthNorN, widthNorP, 42 | widthNorN2, widthNorP2; 43 | 44 | double capInvInput, capInvOutput, capNandInput, capNandOutput, capNorInput, 45 | capNorOutput, capNor2Input, capNor2Output; 46 | }; 47 | 48 | } // namespace CoMN 49 | 50 | #endif // !MAXPOOL_H_ -------------------------------------------------------------------------------- /src/refactor/CoMN_Sim/include/MultilevelSAEncoder.h: -------------------------------------------------------------------------------- 1 | #ifndef MULTILEVELSAENCODER_H_ 2 | #define MULTILEVELSAENCODER_H_ 3 | 4 | #include "../include/BasicUnit.h" 5 | #include "../include/general/MemCell.h" 6 | #include "../include/general/Param.h" 7 | #include "../include/general/Technology.h" 8 | 9 | namespace CoMN { 10 | class MultilevelSAEncoder : public BasicUnit { 11 | public: 12 | MultilevelSAEncoder(Param *_param, Technology *_technology); 13 | virtual ~MultilevelSAEncoder() {} 14 | void Initialize(int _levelOutput, int _numOfEncoders); 15 | void CalculateArea(double _newHeight, double _newWidth, AreaModify _option); 16 | void CalculateLatency(double _rampInput, double numRead); 17 | void CalculatePower(double numRead); 18 | 19 | int levelOutput; 20 | int numOfEncoders; 21 | 22 | private: 23 | Param *param; 24 | Technology *tech; 25 | int numInput, numGate; 26 | double widthInvN, widthInvP, widthNandN, widthNandP; 27 | double capNandInput, capNandOutput, capNandLgInput, capNandLgOutput, 28 | capInvInput, capInvOutput; 29 | }; 30 | } // namespace CoMN 31 | 32 | #endif -------------------------------------------------------------------------------- /src/refactor/CoMN_Sim/include/MultilevelSenseAmp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file MultilevelSenseAmp.h 3 | * @author booniebears 4 | * @brief 5 | * @date 2023-10-18 6 | * 7 | * @copyright Copyright (c) 2023 8 | * 9 | */ 10 | #ifndef MULTILEVELSENSEAMP_H_ 11 | #define MULTILEVELSENSEAMP_H_ 12 | 13 | #include 14 | 15 | #include "../include/BasicUnit.h" 16 | #include "../include/CurrentSenseAmp.h" 17 | #include "../include/general/MemCell.h" 18 | #include "../include/general/Param.h" 19 | #include "../include/general/Technology.h" 20 | 21 | namespace CoMN { 22 | class MultilevelSenseAmp : public BasicUnit { 23 | public: 24 | MultilevelSenseAmp(Param *_param, Technology *_technology); 25 | virtual ~MultilevelSenseAmp() {} 26 | void Initialize(int _levelOutput, int _numOfAmps, bool _isCSA, 27 | bool _isParallel); 28 | void CalculateArea(double _newHeight, double _newWidth, AreaModify _option); 29 | void CalculateLatency(vector &colResistance, double numRead); 30 | void CalculatePower(vector &colResistance, double numRead); 31 | double GetColumnLatency(double resCol); 32 | double GetColumnPower(double resCol); 33 | 34 | int levelOutput; 35 | int numOfAmps; 36 | bool isCSA; // use CSA or VSA? 37 | bool isParallel; 38 | 39 | private: 40 | Param *param; 41 | Technology *tech; 42 | vector Rref; 43 | double widthNMOS, widthPMOS; 44 | }; 45 | } // namespace CoMN 46 | 47 | #endif -------------------------------------------------------------------------------- /src/refactor/CoMN_Sim/include/Mux.h: -------------------------------------------------------------------------------- 1 | #ifndef MUX_H_ 2 | #define MUX_H_ 3 | 4 | #include "../include/BasicUnit.h" 5 | #include "../include/general/MemCell.h" 6 | #include "../include/general/Param.h" 7 | #include "../include/general/Technology.h" 8 | 9 | namespace CoMN { 10 | class Mux : public BasicUnit { 11 | public: 12 | Mux(Param *_param, Technology *_technology); 13 | virtual ~Mux() {} 14 | void Initialize(int _numOfMux, int _numOfInput, double _resTg); 15 | void CalculateArea(double _newHeight, double _newWidth, AreaModify _option); 16 | void CalculateLatency(double _capLoad, double numRead); 17 | void CalculatePower(double numRead); 18 | 19 | int numOfInput; 20 | int numOfMux; // How many mux units 21 | double resTg; 22 | double capTgGateN, capTgGateP, capTgDrain; 23 | 24 | private: 25 | Param *param; 26 | Technology *tech; 27 | // Transistor Parameters 28 | double widthTgN, widthTgP; 29 | }; 30 | } // namespace CoMN 31 | 32 | #endif -------------------------------------------------------------------------------- /src/refactor/CoMN_Sim/include/MuxDecoder.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file MuxDecoder.h 3 | * @author booniebears 4 | * @brief 5 | * @date 2023-10-22 6 | * 7 | * @copyright Copyright (c) 2023 8 | * 9 | */ 10 | #ifndef MUXDECODER_H_ 11 | #define MUXDECODER_H_ 12 | 13 | #include "../include/BasicUnit.h" 14 | #include "../include/general/MemCell.h" 15 | #include "../include/general/Param.h" 16 | #include "../include/general/Technology.h" 17 | #include "../include/general/Types.h" 18 | 19 | namespace CoMN { 20 | class MuxDecoder : public BasicUnit { 21 | public: 22 | MuxDecoder(Param *_param, Technology *_technology); 23 | virtual ~MuxDecoder() {} 24 | void Initialize(DecoderMode _mode, int _inputBits, bool _isMux, 25 | bool _isParallel); 26 | void CalculateArea(double _newHeight, double _newWidth, AreaModify _option); 27 | void CalculateLatency(double _rampInput, double _capLoad1, double _capLoad2, 28 | double numRead, double numWrite); 29 | void CalculatePower(double numRead, double numWrite); 30 | double getRampOutput() { return rampOutput; } 31 | 32 | DecoderMode mode; 33 | int inputBits; // input bits for a decoder 34 | bool isMux; // Decoder for mux, not for WL; 35 | bool isParallel; // if Parallel, increase MUX Decoder by 8 times 36 | 37 | private: 38 | Param *param; 39 | Technology *tech; 40 | // Transistor attributes 41 | double widthInvN, widthInvP, widthNandN, widthNandP, widthNorN, widthNorP, 42 | widthDriverInvN, widthDriverInvP; 43 | int numInv, numNand, numNor, numMetalConnection; 44 | double capInvInput, capInvOutput, capNandInput, capNandOutput, capNorInput, 45 | capNorOutput, capDriverInvInput, capDriverInvOutput; 46 | double rampOutput; 47 | }; 48 | } // namespace CoMN 49 | 50 | #endif -------------------------------------------------------------------------------- /src/refactor/CoMN_Sim/include/NewDecoderDriver.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file NewDecoderDriver.h 3 | * @author booniebears 4 | * @brief 5 | * @date 2023-10-19 6 | * 7 | * @copyright Copyright (c) 2023 8 | * 9 | */ 10 | #ifndef NEWDECODERDRIVER_H_ 11 | #define NEWDECODERDRIVER_H_ 12 | 13 | #include "../include/BasicUnit.h" 14 | #include "../include/general/MemCell.h" 15 | #include "../include/general/Param.h" 16 | #include "../include/general/Technology.h" 17 | 18 | namespace CoMN { 19 | class NewDecoderDriver : public BasicUnit { 20 | public: 21 | NewDecoderDriver(Param *_param, Technology *_technology); 22 | virtual ~NewDecoderDriver() {} 23 | void Initialize(int _numOfRows); 24 | void CalculateArea(double _newHeight, double _newWidth, AreaModify _option); 25 | void CalculateLatency(double _rampInput, double _capLoad, double _resLoad, 26 | double numRead, double numWrite); 27 | void CalculatePower(double numRead, double numWrite); 28 | 29 | int numOfRows; 30 | 31 | private: 32 | Param *param; 33 | Technology *tech; 34 | // Transistor Params 35 | double widthNandN, widthNandP, widthInvN, widthInvP, widthTgN, widthTgP; 36 | double capNandInput, capNandOutput, capInvInput, capInvOutput, capTgGateN, 37 | capTgGateP, capTgDrain; 38 | double resTg; 39 | }; 40 | } // namespace CoMN 41 | 42 | #endif -------------------------------------------------------------------------------- /src/refactor/CoMN_Sim/include/NewSwitchMatrix.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file NewSwitchMatrix.h 3 | * @author booniebears 4 | * @brief 5 | * @date 2023-10-20 6 | * 7 | * @copyright Copyright (c) 2023 8 | * 9 | */ 10 | #ifndef NEWSWITCHMATRIX_H_ 11 | #define NEWSWITCHMATRIX_H_ 12 | 13 | #include "../include/BasicUnit.h" 14 | #include "../include/DFF.h" 15 | #include "../include/general/MemCell.h" 16 | #include "../include/general/Param.h" 17 | #include "../include/general/Technology.h" 18 | 19 | namespace CoMN { 20 | class NewSwitchMatrix : public BasicUnit { 21 | public: 22 | NewSwitchMatrix(Param *_param, Technology *_technology); 23 | virtual ~NewSwitchMatrix() {} 24 | void Initialize(int _numOfLines, double _activityRowRead); 25 | void CalculateArea(double _newHeight, double _newWidth, AreaModify _option); 26 | void CalculateLatency(double _rampInput, double _capLoad, double _resLoad, 27 | double numRead, double numWrite); 28 | void CalculatePower(double numRead, double numWrite); 29 | 30 | int numOfLines; // Num of Output Lines connected to SwitchMatrix 31 | double activityRowRead; 32 | 33 | DFF dff; 34 | 35 | private: 36 | Param *param; 37 | Technology *tech; 38 | double widthTgN, widthTgP; 39 | double resTg; 40 | double capTgDrain, capTgGateN, capTgGateP; 41 | }; 42 | } // namespace CoMN 43 | 44 | #endif -------------------------------------------------------------------------------- /src/refactor/CoMN_Sim/include/Precharger.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Precharger.h 3 | * @author booniebears 4 | * @brief 5 | * @date 2023-10-19 6 | * 7 | * @copyright Copyright (c) 2023 8 | * 9 | */ 10 | #ifndef PRECHARGER_H_ 11 | #define PRECHARGER_H_ 12 | 13 | #include "../include/BasicUnit.h" 14 | #include "../include/general/MemCell.h" 15 | #include "../include/general/Param.h" 16 | #include "../include/general/Technology.h" 17 | 18 | namespace CoMN { 19 | class Precharger : public BasicUnit { 20 | public: 21 | Precharger(Param *_param, Technology *_technology); 22 | virtual ~Precharger() {} 23 | void Initialize(int _numOfLines, double _resLoad, double _activityColWrite); 24 | void CalculateArea(double _newHeight, double _newWidth, AreaModify _option); 25 | void CalculateLatency(double _capLoad, double numRead, double numWrite); 26 | void CalculatePower(double numRead, double numWrite); 27 | 28 | int numOfLines; 29 | double resLoad; 30 | double activityColWrite; 31 | 32 | private: 33 | Param *param; 34 | Technology *tech; 35 | double widthPMOSBitlinePrecharger, widthPMOSBitlineEqual; 36 | double capOutputBitlinePrecharger; 37 | double capLoad; 38 | }; 39 | } // namespace CoMN 40 | 41 | #endif -------------------------------------------------------------------------------- /src/refactor/CoMN_Sim/include/SRAMWriteDriver.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file SRAMWriteDriver.h 3 | * @author booniebears 4 | * @brief 5 | * @date 2023-10-19 6 | * 7 | * @copyright Copyright (c) 2023 8 | * 9 | */ 10 | #ifndef SRAMWRITEDRIVER_H_ 11 | #define SRAMWRITEDRIVER_H_ 12 | 13 | #include "../include/BasicUnit.h" 14 | #include "../include/general/MemCell.h" 15 | #include "../include/general/Param.h" 16 | #include "../include/general/Technology.h" 17 | 18 | namespace CoMN { 19 | class SRAMWriteDriver : public BasicUnit { 20 | public: 21 | SRAMWriteDriver(Param *_param, Technology *_technology); 22 | virtual ~SRAMWriteDriver() {} 23 | void Initialize(int _numOfLines, double _activityColWrite); 24 | void CalculateArea(double _newHeight, double _newWidth, AreaModify _option); 25 | void CalculateLatency(double _rampInput, double _capLoad, double _resLoad, 26 | double numWrite); 27 | void CalculatePower(double numWrite); 28 | 29 | int numOfLines; 30 | double activityColWrite; 31 | 32 | private: 33 | Param *param; 34 | Technology *tech; 35 | double widthInvN, widthInvP; 36 | double capInvInput, capInvOutput; 37 | }; 38 | } // namespace CoMN 39 | 40 | #endif -------------------------------------------------------------------------------- /src/refactor/CoMN_Sim/include/SarADC.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file SarADC.h 3 | * @author booniebears 4 | * @brief 5 | * @date 2023-10-23 6 | * 7 | * @copyright Copyright (c) 2023 8 | * 9 | */ 10 | #ifndef SARADC_H_ 11 | #define SARADC_H_ 12 | 13 | #include 14 | 15 | #include "../include/BasicUnit.h" 16 | #include "../include/general/MemCell.h" 17 | #include "../include/general/Param.h" 18 | #include "../include/general/Technology.h" 19 | 20 | namespace CoMN { 21 | class SarADC : public BasicUnit { 22 | public: 23 | SarADC(Param *_param, Technology *_technology); 24 | virtual ~SarADC() {} 25 | void Initialize(int _levelOutput, int _numOfADCs); 26 | void CalculateArea(double _newHeight, double _newWidth, AreaModify _option); 27 | void CalculateLatency(double numRead); 28 | void CalculatePower(vector &colResistance, double numRead); 29 | double GetColumnPower(double resCol); 30 | 31 | int levelOutput; 32 | int numOfADCs; 33 | 34 | private: 35 | Param *param; 36 | Technology *tech; 37 | double widthNMOS, widthPMOS; 38 | }; 39 | } // namespace CoMN 40 | 41 | #endif -------------------------------------------------------------------------------- /src/refactor/CoMN_Sim/include/SenseAmp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file SenseAmp.h 3 | * @author booniebears 4 | * @brief Sense Amplifier for readout of subarray columns. 5 | * @date 2023-10-22 6 | * 7 | * @copyright Copyright (c) 2023 8 | * 9 | */ 10 | #ifndef SENSEAMP_H_ 11 | #define SENSEAMP_H_ 12 | 13 | #include "../include/BasicUnit.h" 14 | #include "../include/general/MemCell.h" 15 | #include "../include/general/Param.h" 16 | #include "../include/general/Technology.h" 17 | 18 | namespace CoMN { 19 | class SenseAmp : public BasicUnit { 20 | public: 21 | SenseAmp(Param *_param, Technology *_technology); 22 | virtual ~SenseAmp() {} 23 | void Initialize(int _numOfColumns, bool _isCurrentSense, double _senseVoltage, 24 | double _pitchSenseAmp); 25 | void CalculateArea(double _newHeight, double _newWidth, AreaModify _option); 26 | void CalculateLatency(double numRead); 27 | void CalculatePower(double numRead); 28 | 29 | int numOfColumns; 30 | bool isCurrentSense; // Current sense based? 31 | double senseVoltage; // Minimum sensible voltage 32 | double pitchSenseAmp; // maximum width allowed for 1 sense amplifier layout 33 | 34 | private: 35 | Param *param; 36 | Technology *tech; 37 | double capLoad; /* Load capacitance of sense amplifier */ 38 | }; 39 | } // namespace CoMN 40 | 41 | #endif -------------------------------------------------------------------------------- /src/refactor/CoMN_Sim/include/ShiftAdder.h: -------------------------------------------------------------------------------- 1 | #ifndef SHIFTADDER_H_ 2 | #define SHIFTADDER_H_ 3 | 4 | #include "../include/Adder.h" 5 | #include "../include/BasicUnit.h" 6 | #include "../include/DFF.h" 7 | #include "../include/general/MemCell.h" 8 | #include "../include/general/Param.h" 9 | #include "../include/general/Technology.h" 10 | 11 | namespace CoMN { 12 | class ShiftAdder : public BasicUnit { 13 | public: 14 | ShiftAdder(Param *_param, Technology *_technology); 15 | virtual ~ShiftAdder() {} 16 | void Initialize(int _numOfBits, int _numOfAdders, int _numOfReadPulses, 17 | SpikingMode _spikingMode); 18 | void CalculateArea(double _newHeight, double _newWidth, AreaModify _option); 19 | void CalculateLatency(double numRead); 20 | void CalculatePower(double numRead); 21 | 22 | int numOfAdders; 23 | int numOfBits; 24 | int numOfReadPulses; 25 | int numOfDFFs; 26 | SpikingMode spikingMode; // Binary: Adder; Spiking: Counting 27 | 28 | // Transistor attributes 29 | double widthInvN, widthInvP, widthNandN, widthNandP; 30 | int numOfInvs, numOfNands; 31 | 32 | Adder adder; 33 | DFF dff; 34 | 35 | private: 36 | Param *param; 37 | Technology *tech; 38 | }; 39 | } // namespace CoMN 40 | 41 | #endif -------------------------------------------------------------------------------- /src/refactor/CoMN_Sim/include/Sigmoid.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Sigmoid.h 3 | * @author booniebears 4 | * @brief 5 | * @date 2024-01-19 6 | * 7 | * @copyright Copyright (c) 2024 8 | * 9 | */ 10 | 11 | #ifndef SIGMOID_H_ 12 | #define SIGMOID_H_ 13 | 14 | #include "../include/BasicUnit.h" 15 | #include "../include/MuxDecoder.h" 16 | #include "../include/VoltageSenseAmp.h" 17 | #include "../include/general/MemCell.h" 18 | #include "../include/general/Param.h" 19 | #include "../include/general/Technology.h" 20 | 21 | namespace CoMN { 22 | 23 | class Sigmoid : public BasicUnit { 24 | 25 | public: 26 | Sigmoid(Param *_param, Technology *_technology); 27 | void Initialize(int _numOfYBits, int _numOfEntries, int _numOfUnits); 28 | void CalculateArea(double _newHeight, double _newWidth, AreaModify _option); 29 | void CalculateLatency(double numRead); 30 | void CalculatePower(double numRead); 31 | virtual ~Sigmoid() {} 32 | 33 | private: 34 | /* data */ 35 | MuxDecoder wlDecoder; 36 | VoltageSenseAmp voltageSenseAmp; 37 | Param *param; 38 | Technology *tech; 39 | 40 | int numOfYBits, numOfEntries, numOfUnits; 41 | double capSRAMCell, capLoad; 42 | double widthInvN, widthInvP; 43 | double cellWidth, cellHeight; 44 | }; 45 | 46 | } // namespace CoMN 47 | 48 | #endif // !SIGMOID_H_ -------------------------------------------------------------------------------- /src/refactor/CoMN_Sim/include/SwitchMatrix.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file SwitchMatrix.h 3 | * @author booniebears 4 | * @brief 5 | * @date 2023-10-18 6 | * 7 | * @copyright Copyright (c) 2023 8 | * 9 | */ 10 | #ifndef SWITCHMATRIX_H_ 11 | #define SWITCHMATRIX_H_ 12 | 13 | #include "../include/BasicUnit.h" 14 | #include "../include/DFF.h" 15 | #include "../include/general/MemCell.h" 16 | #include "../include/general/Param.h" 17 | #include "../include/general/Technology.h" 18 | 19 | namespace CoMN { 20 | class SwitchMatrix : public BasicUnit { 21 | public: 22 | SwitchMatrix(Param *_param, Technology *_technology); 23 | virtual ~SwitchMatrix() {} 24 | void Initialize(RowColMode _mode, int _numOfLines, double _resTg, 25 | double _activityRowRead, double _activityColWrite, 26 | double _numOfWritePulses); 27 | void CalculateArea(double _newHeight, double _newWidth, AreaModify _option); 28 | void CalculateLatency(double _rampInput, double _capLoad, double _resLoad, 29 | double numRead, double numWrite); 30 | void CalculatePower(double numRead, double numWrite); 31 | double getRampOutput() { return rampOutput; } 32 | 33 | RowColMode mode; 34 | int numOfLines; // Num of Output Lines connected to SwitchMatrix 35 | double resTg; 36 | double activityRowRead; 37 | double activityColWrite; // "write" related members not necessary in training 38 | double numOfWritePulses; // Same as above 39 | 40 | DFF dff; 41 | 42 | private: 43 | Param *param; 44 | Technology *tech; 45 | // Transistor Parameters 46 | double widthTgN, widthTgP; 47 | double TgHeight, TgWidth; 48 | double capTgDrain, capTgGateN, capTgGateP; 49 | double rampOutput; 50 | }; 51 | } // namespace CoMN 52 | 53 | #endif -------------------------------------------------------------------------------- /src/refactor/CoMN_Sim/include/VoltageSenseAmp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file VoltageSenseAmp.h 3 | * @author booniebears 4 | * @brief Voltage Sense amplifier for Sigmoid Implementation. 5 | * @date 2024-01-19 6 | * 7 | * @copyright Copyright (c) 2024 8 | * 9 | */ 10 | 11 | #ifndef VOLTAGESENSEAMP_H_ 12 | #define VOLTAGESENSEAMP_H_ 13 | 14 | #include "../include/BasicUnit.h" 15 | #include "../include/general/MemCell.h" 16 | #include "../include/general/Param.h" 17 | #include "../include/general/Technology.h" 18 | 19 | namespace CoMN { 20 | 21 | class VoltageSenseAmp : public BasicUnit { 22 | 23 | public: 24 | VoltageSenseAmp(Param *_param, Technology *_technology); 25 | virtual ~VoltageSenseAmp() {} 26 | 27 | void Initialize(int _numOfCols); 28 | void CalculateArea(); 29 | void CalculateLatency(double numRead); 30 | void CalculatePower(double numRead); 31 | 32 | private: 33 | /* data */ 34 | Param *param; 35 | Technology *tech; 36 | 37 | int numOfCols; 38 | double widthNMOS, widthPMOS; 39 | double widthVoltageSenseAmp; 40 | double voltageSenseDiff; 41 | double resPrecharge; 42 | double capNMOSGate, capNMOSDrain, capPMOSGate, capPMOSDrain; 43 | double capS1; 44 | }; 45 | 46 | } // namespace CoMN 47 | 48 | #endif // !VOLTAGESENSEAMP_H_ -------------------------------------------------------------------------------- /src/refactor/CoMN_Sim/include/general/Constant.h: -------------------------------------------------------------------------------- 1 | #ifndef CONSTANT_H_ 2 | #define CONSTANT_H_ 3 | 4 | namespace CoMN { 5 | #define INV 0 6 | #define NOR 1 7 | #define NAND 2 8 | 9 | #define NMOS 0 10 | #define PMOS 1 11 | 12 | #define MAX_NMOS_SIZE 100 13 | #define MIN_NMOS_SIZE 2 14 | 15 | #define MAX_TRANSISTOR_HEIGHT 28 16 | #define MAX_TRANSISTOR_HEIGHT_FINFET 34 17 | 18 | #define MIN_GAP_BET_P_AND_N_DIFFS 3.5 // 2 19 | #define MIN_GAP_BET_SAME_TYPE_DIFFS 1.6 // 1.5 20 | #define MIN_GAP_BET_GATE_POLY 2.8 // 1.5 21 | #define MIN_GAP_BET_GATE_POLY_FINFET 3.9 22 | #define MIN_GAP_BET_CONTACT_POLY 0.7 // 0.75 23 | #define CONTACT_SIZE 1.3 // 1 24 | #define MIN_WIDTH_POWER_RAIL 3.4 // 2 25 | #define MIN_POLY_EXT_DIFF 1.0 // Minimum poly extension beyond diffusion region 26 | #define MIN_GAP_BET_FIELD_POLY \ 27 | 1.6 // Field poly means the poly above the field oxide (outside the active 28 | // region) 29 | #define POLY_WIDTH 1.0 30 | #define POLY_WIDTH_FINFET 1.4 31 | #define M2_PITCH 3.2 32 | #define M3_PITCH 2.8 33 | 34 | #define AVG_RATIO_LEAK_2INPUT_NAND 0.48 35 | #define AVG_RATIO_LEAK_3INPUT_NAND 0.31 36 | #define AVG_RATIO_LEAK_2INPUT_NOR 0.95 37 | #define AVG_RATIO_LEAK_3INPUT_NOR 0.62 38 | 39 | #define W_SENSE_P 7.5 40 | #define W_SENSE_N 3.75 41 | #define W_SENSE_ISO 12.5 42 | #define W_SENSE_EN 5.0 43 | #define W_SENSE_MUX 9.0 44 | 45 | #define IR_DROP_TOLERANCE 0.25 46 | #define LINEAR_REGION_RATIO 0.20 47 | 48 | #define HEIGHT_WIDTH_RATIO_LIMIT 5 49 | 50 | #define RATIO_READ_THRESHOLD_VS_VOLTAGE 0.2 51 | 52 | #define INF_RAMP 1e20 // infinity ramp input (rising edge of voltage) 53 | #define MAXPOOL_WINDOW 2*2 54 | } // namespace CoMN 55 | 56 | #endif -------------------------------------------------------------------------------- /src/refactor/CoMN_Sim/include/general/Types.h: -------------------------------------------------------------------------------- 1 | #ifndef TYPES_H_ 2 | #define TYPES_H_ 3 | 4 | namespace CoMN { 5 | namespace Type { // To prevent name collision 6 | enum MemCellType { 7 | SRAM = 1, 8 | RRAM = 2, 9 | FeFET = 3, 10 | }; 11 | } 12 | enum CellAccessType { 13 | CMOS_access = 1, 14 | BJT_access = 2, 15 | diode_access = 3, 16 | none_access = 4 17 | }; 18 | 19 | enum DeviceRoadmap { 20 | HP = 1, /* High performance */ 21 | LSTP = 2 /* Low standby power */ 22 | }; 23 | 24 | enum TransistorType { 25 | Conventional = 1, /* Conventional CMOS */ 26 | FET_2D = 2, /* 2D FET */ 27 | TFET = 3 28 | }; 29 | 30 | enum AreaModify { 31 | NONE = 1, /* No action, just use the original area calculation */ 32 | MAGIC = 2, /* Use magic folding based on the original area */ 33 | OVERRIDE = 3 /* directly modify the height and width and calculate new area */ 34 | }; 35 | 36 | enum DecoderMode { 37 | REGULAR_ROW = 1, /* Regular row mode */ 38 | REGULAR_COL = 2 /* Regular column mode */ 39 | }; 40 | 41 | enum RowColMode { 42 | ROW_MODE = 1, // Connect to rows 43 | COL_MODE = 2 // Connect to columns 44 | }; 45 | 46 | enum ReadCircuitMode { 47 | CMOS = 1, /* Normal read circuit */ 48 | OSCILLATION = 2 /* NbO2 */ 49 | }; 50 | 51 | enum SpikingMode { 52 | NONSPIKING = 1, /* Binary format */ 53 | SPIKING = 2 54 | }; 55 | 56 | enum BusMode { 57 | HORIZONTAL = 1, /* horizontal bus */ 58 | VERTICAL = 2, /* vertical bus */ 59 | }; 60 | } // namespace CoMN 61 | 62 | #endif -------------------------------------------------------------------------------- /src/refactor/CoMN_Sim/src/BasicUnit.cpp: -------------------------------------------------------------------------------- 1 | #include "../include/BasicUnit.h" 2 | 3 | namespace CoMN { 4 | BasicUnit::BasicUnit() { 5 | height = 0; 6 | width = 0; 7 | area = 0; 8 | usedArea = 0; 9 | readLatency = 0, writeLatency = 0; 10 | readDynamicEnergy = 0, writeDynamicEnergy = 0; 11 | leakage = 0; 12 | } 13 | } // namespace CoMN 14 | -------------------------------------------------------------------------------- /src/refactor/CoMN_Sim/src/BitShifter.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file BitShifter.cpp 3 | * @author booniebears 4 | * @brief The implementation of ReLU unit. 5 | * @date 2023-11-07 6 | * 7 | * @copyright Copyright (c) 2023 8 | * 9 | */ 10 | 11 | #include "../include/BitShifter.h" 12 | #include "../include/general/Constant.h" 13 | #include "../include/general/Formula.h" 14 | 15 | namespace CoMN { 16 | BitShifter::BitShifter(Param *_param, Technology *_technology) 17 | : param(_param), tech(_technology), BasicUnit(), dff(_param, _technology) {} 18 | 19 | void BitShifter::Initialize(int _numOfBits, int _numOfUnits) { 20 | numOfBits = _numOfBits; 21 | numOfUnits = _numOfUnits; 22 | numOfDFFs = numOfUnits * numOfBits; 23 | dff.Initialize(numOfDFFs); 24 | } 25 | 26 | void BitShifter::CalculateArea(double _newHeight, double _newWidth, 27 | AreaModify _option) { 28 | dff.CalculateArea(0, 0, NONE); // get one row of DFFs by default 29 | area = dff.area; 30 | if (_newWidth && _option == NONE) { 31 | width = _newWidth; 32 | height = area / width; 33 | } else { 34 | height = _newHeight; 35 | width = area / height; 36 | } 37 | } 38 | 39 | void BitShifter::CalculateLatency(double numRead) { 40 | dff.CalculateLatency(1); 41 | readLatency = dff.readLatency * numRead; 42 | } 43 | 44 | void BitShifter::CalculatePower(double numRead) { 45 | // cout << "********** BitShifter::CalculatePower Begins **********" << endl; 46 | dff.CalculatePower(numRead, numOfDFFs); 47 | leakage += dff.leakage; 48 | readDynamicEnergy += dff.readDynamicEnergy; 49 | // cout << "numRead = " << numRead << endl; 50 | // cout << "numOfDFFs = " << numOfDFFs << endl; 51 | // cout << "numOfBits = " << numOfBits << endl; 52 | // cout << "numOfUnits = " << numOfUnits << endl; 53 | // cout << "********** BitShifter::CalculatePower Ends **********" << endl; 54 | } 55 | 56 | } // namespace CoMN 57 | -------------------------------------------------------------------------------- /src/refactor/PE.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file PE.h 3 | * @author booniebears 4 | * @brief 5 | * @date 2023-11-28 6 | * 7 | * @copyright Copyright (c) 2023 8 | * 9 | */ 10 | 11 | #ifndef PE_H_ 12 | #define PE_H_ 13 | 14 | #include "json.hpp" 15 | #include 16 | #include 17 | 18 | using namespace std; 19 | using json = nlohmann::json; 20 | 21 | namespace Refactor { 22 | 23 | struct PEInfo { 24 | vector Subarray; 25 | double MaxConductance, MinConductance; 26 | int ADCNum, ADCLevel; // ADCNum: How many ADCs in a macro 27 | double ADC_power, ADC_fre, ADC_area; 28 | }; 29 | 30 | struct CoMNInfo { 31 | int technode, numRowSubArray, numColSubArray, levelOutput, numColMuxed; 32 | double featuresize, readPulseWidth, readVoltage, resistanceOn, resistanceOff, 33 | ADC_power, ADC_delay, ADC_area; 34 | bool user_defined; 35 | }; 36 | 37 | void PE_core_energy(PEInfo &info, int featureSize); 38 | 39 | void CoMN_interface(CoMNInfo &info); 40 | 41 | } // namespace Refactor 42 | 43 | #endif // !PE_H_ 44 | -------------------------------------------------------------------------------- /src/refactor/Perf_Evaluator.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Perf_Evaluator.h 3 | * @author booniebears 4 | * @brief Evaluate the performance info of the whole CIM arch. 5 | * @date 2023-11-28 6 | * 7 | * @copyright Copyright (c) 2023 8 | * 9 | */ 10 | 11 | #ifndef PERF_EVALUATOR_H_ 12 | #define PERF_EVALUATOR_H_ 13 | 14 | namespace Refactor { 15 | 16 | // The interface of Calculating the Performance of all modules required. 17 | // Include Macro,Buffer,Mesh,SFU,Htree etc. 18 | void PPA_cost(); 19 | 20 | // Performance of buffer 21 | void Buffer_Perf(int bufferSize, int buswidth, int featureSize); 22 | 23 | // Performance of Orion(routers) 24 | void Orion_Perf(int Fliter_size, int inPorts, int outPorts, int v_channels, 25 | double freq, int featureSize, bool isMesh); 26 | 27 | } // namespace Refactor 28 | 29 | #endif // !PERF_EVALUATOR_H_ 30 | -------------------------------------------------------------------------------- /src/refactor/PyActInput.cpp: -------------------------------------------------------------------------------- 1 | #include "PyActInput.h" 2 | /** 3 | * @file PyActInput.cpp 4 | * @author booniebears 5 | * @brief 6 | * @date 2023-11-24 7 | * 8 | * @copyright Copyright (c) 2023 9 | * 10 | */ 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | #include "PyActInput.h" 17 | 18 | namespace Refactor { 19 | 20 | PyActInput::PyActInput() { 21 | ifstream inputInfo("../../data_transmiss/PyActInput.txt"); 22 | string line; 23 | if (inputInfo.is_open()) { 24 | while (getline(inputInfo, line)) { 25 | istringstream iss(line); 26 | string key, value; 27 | getline(iss, key, ':'); 28 | getline(iss, value); 29 | 30 | key.erase(key.find_last_not_of(" ") + 1); 31 | value.erase(0, key.find_first_not_of(" ")); 32 | if (key == "shape") { 33 | istringstream ss(value); 34 | string token; 35 | while (getline(ss, token, ',')) { 36 | shape.push_back(stoi(token)); 37 | } 38 | } else if (key == "mode") { 39 | // mode can be 0,1,2,representing relu,maxpool and sigmoid. 40 | mode = stoi(value); 41 | } 42 | } 43 | // for (auto i : shape) { 44 | // cout << i << " "; 45 | // } 46 | // cout << endl; 47 | // cout << "mode = " << mode << endl; 48 | } else { 49 | throw runtime_error("Cannot Open PyActInput.txt!!"); 50 | } 51 | } 52 | 53 | } // namespace Refactor 54 | -------------------------------------------------------------------------------- /src/refactor/PyActInput.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file PyActInput.h 3 | * @author booniebears 4 | * @brief For input of activations like relu && maxpool 5 | * @date 2023-11-24 6 | * 7 | * @copyright Copyright (c) 2023 8 | * 9 | */ 10 | 11 | #ifndef PYACTINPUT_H_ 12 | #define PYACTINPUT_H_ 13 | 14 | #include 15 | 16 | using namespace std; 17 | 18 | namespace Refactor { 19 | class PyActInput { 20 | public: 21 | PyActInput(); 22 | virtual ~PyActInput() {} 23 | 24 | vector shape; // shape.size() == 2 || shape.size() == 4 25 | int mode; 26 | }; 27 | 28 | } // namespace Refactor 29 | 30 | #endif // !PYACTINPUT_H_ -------------------------------------------------------------------------------- /src/refactor/PyInput.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file PyInput.cpp 3 | * @author booniebears 4 | * @brief 5 | * @date 2023-11-20 6 | * 7 | * @copyright Copyright (c) 2023 8 | * 9 | */ 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #include "PyInput.h" 16 | 17 | namespace Refactor { 18 | 19 | PyInput::PyInput() { 20 | ifstream inputInfo; 21 | inputInfo.open("../../data_transmiss/PyInput.txt"); 22 | string line; 23 | if (inputInfo.is_open()) { 24 | while (getline(inputInfo, line)) { 25 | istringstream iss(line); 26 | string key, value; 27 | getline(iss, key, ':'); 28 | getline(iss, value); 29 | 30 | key.erase(key.find_last_not_of(" ") + 1); 31 | value.erase(0, key.find_first_not_of(" ")); 32 | if (key == "shape") { 33 | istringstream ss(value); 34 | string token; 35 | while (getline(ss, token, ',')) { 36 | shape.push_back(stoi(token)); 37 | } 38 | } else if (key == "input_sparsity") { 39 | input_sparsity = stod(value); 40 | } 41 | } 42 | // for (auto i : shape) { 43 | // cout << i << " "; 44 | // } 45 | // cout << endl; 46 | // cout << "input_sparsity = " << input_sparsity << endl; 47 | } else { 48 | throw runtime_error("Cannot Open PyInput.txt!!"); 49 | } 50 | } 51 | 52 | } // namespace Refactor 53 | -------------------------------------------------------------------------------- /src/refactor/PyInput.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file PyInput.h 3 | * @author booniebears 4 | * @brief 5 | * @date 2023-11-20 6 | * 7 | * @copyright Copyright (c) 2023 8 | * 9 | */ 10 | 11 | #ifndef PYINPUT_H_ 12 | #define PYINPUT_H_ 13 | 14 | #include 15 | 16 | using namespace std; 17 | 18 | namespace Refactor { 19 | 20 | class PyInput { 21 | public: 22 | PyInput(); 23 | virtual ~PyInput() {} 24 | 25 | // shape.size() == 2 || shape.size() == 4 for linear/Conv/LW Matmul. 26 | // For RW Matmul, the shape.size() can be veried. 27 | vector shape; 28 | double input_sparsity; 29 | }; 30 | 31 | } // namespace Refactor 32 | 33 | #endif // !PYINPUT_H_ -------------------------------------------------------------------------------- /src/refactor/PyParam.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file PyParam.h 3 | * @author booniebears 4 | * @brief 5 | * @date 2023-11-19 6 | * 7 | * @copyright Copyright (c) 2023 8 | * 9 | */ 10 | 11 | #ifndef PYPARAM_H_ 12 | #define PYPARAM_H_ 13 | 14 | #include 15 | using namespace std; 16 | namespace Refactor { 17 | 18 | class PyParam { 19 | public: 20 | PyParam(); 21 | virtual ~PyParam() {} 22 | 23 | int layer; // The number of layer in a network 24 | pair stride; // stride in width and height 25 | pair kernel_size; // kernel_size in width and height 26 | pair padding; // padding in width and height 27 | int w_precision; // weight precision 28 | int a_precision; // activation precision 29 | }; 30 | 31 | } // namespace Refactor 32 | 33 | #endif // !PYPARAM_H_ -------------------------------------------------------------------------------- /src/refactor/PyWeight.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file PyWeight.cpp 3 | * @author booniebears 4 | * @brief 5 | * @date 2023-11-20 6 | * 7 | * @copyright Copyright (c) 2023 8 | * 9 | */ 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #include "PyWeight.h" 17 | 18 | namespace Refactor { 19 | PyWeight::PyWeight() { 20 | ifstream weightInfo; 21 | weightInfo.open("../../data_transmiss/PyWeight.txt"); 22 | string line; 23 | if (weightInfo.is_open()) { 24 | while (getline(weightInfo, line)) { 25 | istringstream iss(line); 26 | string key, value; 27 | getline(iss, key, ':'); 28 | getline(iss, value); 29 | 30 | key.erase(key.find_last_not_of(" ") + 1); 31 | value.erase(0, key.find_first_not_of(" ")); 32 | if (key == "shape") { 33 | istringstream ss(value); 34 | string token; 35 | while (getline(ss, token, ',')) { 36 | shape.push_back(stoi(token)); 37 | } 38 | } else if (key == "weight_sparsity") { 39 | weight_sparsity = stod(value); 40 | } else if (key == "type") { 41 | // "type" is an identifier for Matmul. there are two possible values: 42 | // "LW" -- weight on the left and "RW" -- weight on the right. 43 | type = value; 44 | type.erase(0, type.find_first_not_of(" ")); 45 | } 46 | } 47 | // for (auto i : shape) { 48 | // cout << i << " "; 49 | // } 50 | // cout << endl; 51 | // cout << "weight_sparsity = " << weight_sparsity << endl; 52 | } else { 53 | throw runtime_error("Cannot Open PyWeight.txt!!"); 54 | } 55 | } 56 | 57 | } // namespace Refactor 58 | -------------------------------------------------------------------------------- /src/refactor/PyWeight.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file PyWeight.h 3 | * @author booniebears 4 | * @brief 5 | * @date 2023-11-20 6 | * 7 | * @copyright Copyright (c) 2023 8 | * 9 | */ 10 | 11 | #ifndef PYWEIGHT_H_ 12 | #define PYWEIGHT_H_ 13 | 14 | #include 15 | 16 | using namespace std; 17 | namespace Refactor { 18 | class PyWeight { 19 | public: 20 | PyWeight(); 21 | virtual ~PyWeight() {} 22 | 23 | vector shape; // shape.size() == 2 || shape.size() == 4 24 | double weight_sparsity; 25 | string type = ""; 26 | }; 27 | 28 | } // namespace Refactor 29 | 30 | #endif // !PYWEIGHT_H_ -------------------------------------------------------------------------------- /src/refactor/run.sh: -------------------------------------------------------------------------------- 1 | if [ ! -d "build" ]; then 2 | mkdir build 3 | fi 4 | cd build 5 | cmake .. 6 | make -j8 7 | # ./main --PPA_cost tcad 1 -------------------------------------------------------------------------------- /src/refactor/test/test_partition.txt: -------------------------------------------------------------------------------- 1 | Split_tile[0]: 1 Split_tile[1]: 1 Split_array[0]: 0.052734375 Split_array[1]: 1 intraTile: 1 interTile: 1 duplication: 1 fold_copies: 1 2 | Split_tile[0]: 1 Split_tile[1]: 1 Split_array[0]: 0.75 Split_array[1]: 1.875 intraTile: 1 interTile: 1 duplication: 1 fold_copies: 2 3 | Split_tile[0]: 1 Split_tile[1]: 2 Split_array[0]: 1.5 Split_array[1]: 1.875 intraTile: 1 interTile: 2 duplication: 1 fold_copies: 2 4 | Split_tile[0]: 1 Split_tile[1]: 4 Split_array[0]: 1.5 Split_array[1]: 1.875 intraTile: 1 interTile: 4 duplication: 1 fold_copies: 1 5 | Split_tile[0]: 1 Split_tile[1]: 8 Split_array[0]: 1.5 Split_array[1]: 1.875 intraTile: 1 interTile: 8 duplication: 1 fold_copies: 1 6 | Split_tile[0]: 2 Split_tile[1]: 8 Split_array[0]: 1.5 Split_array[1]: 1.875 intraTile: 1 interTile: 16 duplication: 1 fold_copies: 1 7 | Split_tile[0]: 2 Split_tile[1]: 8 Split_array[0]: 1.5 Split_array[1]: 1.875 intraTile: 1 interTile: 16 duplication: 1 fold_copies: 1 8 | Split_tile[0]: 2 Split_tile[1]: 8 Split_array[0]: 1.5 Split_array[1]: 1.875 intraTile: 1 interTile: 16 duplication: 1 fold_copies: 1 9 | Split_tile[0]: 1 Split_tile[1]: 1 Split_array[0]: 1 Split_array[1]: 1 intraTile: 1 interTile: 1 duplication: 1 fold_copies: 1 10 | Split_tile[0]: 1 Split_tile[1]: 1 Split_array[0]: 1 Split_array[1]: 1 intraTile: 1 interTile: 1 duplication: 1 fold_copies: 1 11 | Split_tile[0]: 1 Split_tile[1]: 1 Split_array[0]: 1 Split_array[1]: 0.01953125 intraTile: 1 interTile: 1 duplication: 1 fold_copies: 1 12 | -------------------------------------------------------------------------------- /src/refactor/tests.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file tests.cpp 3 | * @author booniebears 4 | * @brief 5 | * @date 2023-12-18 6 | * 7 | * @copyright Copyright (c) 2023 8 | * 9 | */ 10 | 11 | #include 12 | #include 13 | 14 | #include "Mesh_Placing.h" 15 | #include "tests.h" 16 | 17 | namespace Refactor { 18 | 19 | // /** 20 | // * @brief test schedule_idle() in Mesh_Placing. Given an ordered set of traffic 21 | // * routes, calculate the total traffic time of NoC. 22 | // * 23 | // */ 24 | // void test_schedule_idle() { 25 | // // arbitrarily assign values here. 26 | // Mesh_Placing *placing = new Mesh_Placing(1, 1, 1, 1); 27 | // // (1,1) -> (3,2), send = 5, transfer = 1 28 | // placing->schedule_idle(3, 2, 1, 1, 5, 1); 29 | // // (1,1) -> (1,3), send = 4, transfer = 1 30 | // placing->schedule_idle(1, 3, 1, 1, 4, 1); 31 | // // (2,1) -> (0,2), send = 5, transfer = 1 32 | // placing->schedule_idle(0, 2, 2, 1, 5, 1); 33 | // // (3,1) -> (3,3), send = 4, transfer = 1 34 | // placing->schedule_idle(3, 3, 3, 1, 4, 1); 35 | // // (2,0) -> (0,0), send = 8, transfer = 1 36 | // placing->schedule_idle(0, 0, 2, 0, 8, 1); 37 | 38 | // free(placing); 39 | // } 40 | 41 | } // namespace Refactor 42 | -------------------------------------------------------------------------------- /src/refactor/tests.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file tests.h 3 | * @author booniebears 4 | * @brief 5 | * @date 2023-12-18 6 | * 7 | * @copyright Copyright (c) 2023 8 | * 9 | */ 10 | 11 | #ifndef TESTS_H_ 12 | #define TESTS_H_ 13 | 14 | using namespace std; 15 | 16 | namespace Refactor { 17 | 18 | // void test_schedule_idle(); 19 | 20 | } // namespace Refactor 21 | 22 | #endif // !TESTS_H_ --------------------------------------------------------------------------------