odatix 3.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- odatix-3.0.1/MANIFEST.in +7 -0
- odatix-3.0.1/PKG-INFO +19 -0
- odatix-3.0.1/README.md +0 -0
- odatix-3.0.1/odatix/__init__.py +0 -0
- odatix-3.0.1/odatix/components/__init__.py +0 -0
- odatix-3.0.1/odatix/components/clean.py +142 -0
- odatix-3.0.1/odatix/components/export_benchmark.py +176 -0
- odatix-3.0.1/odatix/components/export_results.py +420 -0
- odatix-3.0.1/odatix/components/motd.py +118 -0
- odatix-3.0.1/odatix/components/run_fmax_synthesis.py +470 -0
- odatix-3.0.1/odatix/components/run_simulations.py +282 -0
- odatix-3.0.1/odatix/explorer/__init__.py +0 -0
- odatix-3.0.1/odatix/explorer/assets/icons/sidebar-panel-collapse-icon.svg +1 -0
- odatix-3.0.1/odatix/explorer/assets/icons/sidebar-panel-expand-icon.svg +1 -0
- odatix-3.0.1/odatix/explorer/assets/style.css +208 -0
- odatix-3.0.1/odatix/explorer/explorer_app.py +177 -0
- odatix-3.0.1/odatix/explorer/legend.py +127 -0
- odatix-3.0.1/odatix/explorer/navigation.py +139 -0
- odatix-3.0.1/odatix/explorer/page_radar.py +457 -0
- odatix-3.0.1/odatix/explorer/page_vs.py +339 -0
- odatix-3.0.1/odatix/explorer/page_xy.py +335 -0
- odatix-3.0.1/odatix/lib/__init__.py +0 -0
- odatix-3.0.1/odatix/lib/ansi_to_curses.py +130 -0
- odatix-3.0.1/odatix/lib/architecture_handler.py +673 -0
- odatix-3.0.1/odatix/lib/check_tool.py +62 -0
- odatix-3.0.1/odatix/lib/parallel_job_handler.py +617 -0
- odatix-3.0.1/odatix/lib/prepare_work.py +43 -0
- odatix-3.0.1/odatix/lib/printc.py +94 -0
- odatix-3.0.1/odatix/lib/re_helper.py +34 -0
- odatix-3.0.1/odatix/lib/replace_params.py +103 -0
- odatix-3.0.1/odatix/lib/run_settings.py +81 -0
- odatix-3.0.1/odatix/lib/settings.py +184 -0
- odatix-3.0.1/odatix/lib/simulation_handler.py +333 -0
- odatix-3.0.1/odatix/lib/utils.py +142 -0
- odatix-3.0.1/odatix/odatix_explorer.py +139 -0
- odatix-3.0.1/odatix/odatix_main.py +372 -0
- odatix-3.0.1/odatix/version.txt +1 -0
- odatix-3.0.1/odatix.egg-info/PKG-INFO +19 -0
- odatix-3.0.1/odatix.egg-info/SOURCES.txt +193 -0
- odatix-3.0.1/odatix.egg-info/dependency_links.txt +1 -0
- odatix-3.0.1/odatix.egg-info/entry_points.txt +3 -0
- odatix-3.0.1/odatix.egg-info/requires.txt +7 -0
- odatix-3.0.1/odatix.egg-info/top_level.txt +4 -0
- odatix-3.0.1/odatix_eda_tools/_common/find_fmax.tcl +243 -0
- odatix-3.0.1/odatix_eda_tools/_common/init_script.tcl +44 -0
- odatix-3.0.1/odatix_eda_tools/_common/settings.tcl +83 -0
- odatix-3.0.1/odatix_eda_tools/design_compiler/makefile.mk +83 -0
- odatix-3.0.1/odatix_eda_tools/design_compiler/tcl/analyze_script.tcl +85 -0
- odatix-3.0.1/odatix_eda_tools/design_compiler/tcl/is_slack_met.tcl +50 -0
- odatix-3.0.1/odatix_eda_tools/design_compiler/tcl/summary.tcl +96 -0
- odatix-3.0.1/odatix_eda_tools/design_compiler/tcl/synth_script.tcl +209 -0
- odatix-3.0.1/odatix_eda_tools/design_compiler/tcl/update_freq.tcl +26 -0
- odatix-3.0.1/odatix_eda_tools/design_compiler/technology/AMS_350nm_CMOS/synopsys_dc_setup.tcl +39 -0
- odatix-3.0.1/odatix_eda_tools/design_compiler/technology/XFAB_180nm_CMOS/synopsys_dc_setup.tcl +33 -0
- odatix-3.0.1/odatix_eda_tools/design_compiler/tool.yml +126 -0
- odatix-3.0.1/odatix_eda_tools/dummy/makefile.mk +86 -0
- odatix-3.0.1/odatix_eda_tools/dummy/tcl/analyze_script.tcl +0 -0
- odatix-3.0.1/odatix_eda_tools/dummy/tcl/is_slack_met.tcl +46 -0
- odatix-3.0.1/odatix_eda_tools/dummy/tcl/summary.tcl +0 -0
- odatix-3.0.1/odatix_eda_tools/dummy/tcl/synth_script.tcl +70 -0
- odatix-3.0.1/odatix_eda_tools/dummy/tcl/update_freq.tcl +29 -0
- odatix-3.0.1/odatix_eda_tools/dummy/tool.yml +15 -0
- odatix-3.0.1/odatix_eda_tools/openlane/makefile.mk +136 -0
- odatix-3.0.1/odatix_eda_tools/openlane/scripts/gen_config.py +144 -0
- odatix-3.0.1/odatix_eda_tools/openlane/tcl/analyze_script.tcl +0 -0
- odatix-3.0.1/odatix_eda_tools/openlane/tcl/init_script.tcl +47 -0
- odatix-3.0.1/odatix_eda_tools/openlane/tcl/is_slack_met.tcl +49 -0
- odatix-3.0.1/odatix_eda_tools/openlane/tcl/summary.tcl +0 -0
- odatix-3.0.1/odatix_eda_tools/openlane/tcl/synth_script.tcl +58 -0
- odatix-3.0.1/odatix_eda_tools/openlane/tcl/update_freq.tcl +38 -0
- odatix-3.0.1/odatix_eda_tools/openlane/tool.yml +94 -0
- odatix-3.0.1/odatix_eda_tools/vivado/makefile.mk +159 -0
- odatix-3.0.1/odatix_eda_tools/vivado/tcl/analyze_script.tcl +71 -0
- odatix-3.0.1/odatix_eda_tools/vivado/tcl/is_slack_met.tcl +46 -0
- odatix-3.0.1/odatix_eda_tools/vivado/tcl/summary.tcl +136 -0
- odatix-3.0.1/odatix_eda_tools/vivado/tcl/synth_script.tcl +173 -0
- odatix-3.0.1/odatix_eda_tools/vivado/tcl/update_freq.tcl +29 -0
- odatix-3.0.1/odatix_eda_tools/vivado/tool.yml +92 -0
- odatix-3.0.1/odatix_examples/examples/alu_chisel/build.sbt +31 -0
- odatix-3.0.1/odatix_examples/examples/alu_chisel/project/build.properties +1 -0
- odatix-3.0.1/odatix_examples/examples/alu_chisel/project/plugins.sbt +1 -0
- odatix-3.0.1/odatix_examples/examples/alu_chisel/src/main/scala/ALU.scala +32 -0
- odatix-3.0.1/odatix_examples/examples/alu_chisel/src/main/scala/ALUTop.scala +40 -0
- odatix-3.0.1/odatix_examples/examples/alu_chisel/src/main/scala/pck_control.scala +20 -0
- odatix-3.0.1/odatix_examples/examples/alu_sv/alu.sv +44 -0
- odatix-3.0.1/odatix_examples/examples/alu_sv/alu_top.sv +43 -0
- odatix-3.0.1/odatix_examples/examples/alu_sv/pck_control.sv +24 -0
- odatix-3.0.1/odatix_examples/examples/counter_chisel/build.sbt +31 -0
- odatix-3.0.1/odatix_examples/examples/counter_chisel/project/build.properties +1 -0
- odatix-3.0.1/odatix_examples/examples/counter_chisel/project/plugins.sbt +1 -0
- odatix-3.0.1/odatix_examples/examples/counter_chisel/src/main/scala/counter.scala +42 -0
- odatix-3.0.1/odatix_examples/examples/counter_sv/counter.sv +32 -0
- odatix-3.0.1/odatix_examples/examples/counter_verilog/counter.v +32 -0
- odatix-3.0.1/odatix_examples/examples/counter_vhdl/counter.vhdl +42 -0
- odatix-3.0.1/odatix_examples/examples/mult/mult.sv +38 -0
- odatix-3.0.1/odatix_examples/examples/shift_register_chisel/build.sbt +31 -0
- odatix-3.0.1/odatix_examples/examples/shift_register_chisel/project/build.properties +1 -0
- odatix-3.0.1/odatix_examples/examples/shift_register_chisel/project/plugins.sbt +1 -0
- odatix-3.0.1/odatix_examples/examples/shift_register_chisel/src/main/scala/ShiftRegister.scala +34 -0
- odatix-3.0.1/odatix_examples/examples/shift_register_sv/shift_register.sv +28 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_ALU_chisel/04bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_ALU_chisel/08bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_ALU_chisel/16bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_ALU_chisel/24bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_ALU_chisel/32bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_ALU_chisel/48bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_ALU_chisel/64bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_ALU_chisel/_settings.yml +47 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_ALU_sv/04bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_ALU_sv/08bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_ALU_sv/16bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_ALU_sv/24bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_ALU_sv/32bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_ALU_sv/48bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_ALU_sv/64bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_ALU_sv/_settings.yml +41 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_chisel/04bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_chisel/08bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_chisel/16bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_chisel/24bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_chisel/32bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_chisel/48bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_chisel/64bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_chisel/_settings.yml +47 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_sv/04bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_sv/08bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_sv/16bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_sv/24bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_sv/32bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_sv/48bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_sv/64bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_sv/_settings.yml +41 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_verilog/04bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_verilog/08bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_verilog/16bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_verilog/24bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_verilog/32bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_verilog/48bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_verilog/64bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_verilog/_settings.yml +41 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_vhdl/04bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_vhdl/08bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_vhdl/16bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_vhdl/24bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_vhdl/32bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_vhdl/48bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_vhdl/64bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Counter_vhdl/_settings.yml +63 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Mult/04bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Mult/08bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Mult/16bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Mult/24bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Mult/32bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Mult/48bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Mult/64bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Mult/_settings.yml +41 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Shift_Register_chisel/04bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Shift_Register_chisel/08bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Shift_Register_chisel/16bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Shift_Register_chisel/24bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Shift_Register_chisel/32bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Shift_Register_chisel/48bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Shift_Register_chisel/64bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Shift_Register_chisel/_settings.yml +44 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Shift_Register_sv/04bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Shift_Register_sv/08bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Shift_Register_sv/16bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Shift_Register_sv/24bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Shift_Register_sv/32bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Shift_Register_sv/48bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Shift_Register_sv/64bits.txt +1 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/architectures/Example_Shift_Register_sv/_settings.yml +38 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/clean.yml +25 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/fmax_synthesis_settings.yml +98 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/simulations/TB_Example_Counter_GHDL/Makefile +117 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/simulations/TB_Example_Counter_GHDL/_settings.yml +14 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/simulations/TB_Example_Counter_GHDL/tb/tb_counter.vhdl +119 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/simulations/TB_Example_Counter_Verilator/Makefile +167 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/simulations/TB_Example_Counter_Verilator/tb/tb_counter.cpp +157 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/simulations_settings.yml +61 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/target_design_compiler.yml +34 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/target_dummy.yml +16 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/target_openlane.yml +20 -0
- odatix-3.0.1/odatix_examples/odatix_userconfig/target_vivado.yml +35 -0
- odatix-3.0.1/odatix_init/odatix.yml +21 -0
- odatix-3.0.1/odatix_init/odatix_userconfig/clean.yml +25 -0
- odatix-3.0.1/odatix_init/odatix_userconfig/fmax_synthesis_settings.yml +30 -0
- odatix-3.0.1/odatix_init/odatix_userconfig/simulations_settings.yml +31 -0
- odatix-3.0.1/odatix_init/odatix_userconfig/target_design_compiler.yml +34 -0
- odatix-3.0.1/odatix_init/odatix_userconfig/target_dummy.yml +16 -0
- odatix-3.0.1/odatix_init/odatix_userconfig/target_openlane.yml +20 -0
- odatix-3.0.1/odatix_init/odatix_userconfig/target_vivado.yml +35 -0
- odatix-3.0.1/requirements.txt +7 -0
- odatix-3.0.1/setup.cfg +4 -0
- odatix-3.0.1/setup.py +57 -0
odatix-3.0.1/MANIFEST.in
ADDED
odatix-3.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: odatix
|
|
3
|
+
Version: 3.0.1
|
|
4
|
+
Summary: A FPGA/ASIC toolbox for design space exploration
|
|
5
|
+
Home-page: https://github.com/jsaussereau/Asterism
|
|
6
|
+
Author: Jonathan Saussereau
|
|
7
|
+
Author-email: jonathan.saussereau@ims-bordeaux.fr
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.6
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
Requires-Dist: dash
|
|
14
|
+
Requires-Dist: Flask
|
|
15
|
+
Requires-Dist: numpy
|
|
16
|
+
Requires-Dist: pandas
|
|
17
|
+
Requires-Dist: plotly
|
|
18
|
+
Requires-Dist: PyYAML
|
|
19
|
+
Requires-Dist: waitress
|
odatix-3.0.1/README.md
ADDED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# ********************************************************************** #
|
|
2
|
+
# Odatix #
|
|
3
|
+
# ********************************************************************** #
|
|
4
|
+
#
|
|
5
|
+
# Copyright (C) 2022 Jonathan Saussereau
|
|
6
|
+
#
|
|
7
|
+
# This file is part of Odatix.
|
|
8
|
+
# Odatix is free software: you can redistribute it and/or modify
|
|
9
|
+
# it under the terms of the GNU General Public License as published by
|
|
10
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
# (at your option) any later version.
|
|
12
|
+
#
|
|
13
|
+
# Odatix is distributed in the hope that it will be useful,
|
|
14
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
# GNU General Public License for more details.
|
|
17
|
+
#
|
|
18
|
+
# You should have received a copy of the GNU General Public License
|
|
19
|
+
# along with Odatix. If not, see <https://www.gnu.org/licenses/>.
|
|
20
|
+
#
|
|
21
|
+
|
|
22
|
+
import os
|
|
23
|
+
import sys
|
|
24
|
+
import yaml
|
|
25
|
+
import glob
|
|
26
|
+
import shutil
|
|
27
|
+
import argparse
|
|
28
|
+
|
|
29
|
+
import odatix.lib.printc as printc
|
|
30
|
+
from odatix.lib.utils import read_from_list, KeyNotInListError, BadValueInListError
|
|
31
|
+
from odatix.lib.settings import OdatixSettings
|
|
32
|
+
|
|
33
|
+
script_name = os.path.basename(__file__)
|
|
34
|
+
|
|
35
|
+
DANGEROUS_PATHS = ["/", "./", "./*", "*", "~", ".", ".."]
|
|
36
|
+
|
|
37
|
+
######################################
|
|
38
|
+
# Parse Arguments
|
|
39
|
+
######################################
|
|
40
|
+
|
|
41
|
+
def add_arguments(parser):
|
|
42
|
+
parser.add_argument("-i", "--input", default=OdatixSettings.DEFAULT_CLEAN_SETTINGS_FILE, help="input settings file (default: " + OdatixSettings.DEFAULT_CLEAN_SETTINGS_FILE + ")")
|
|
43
|
+
parser.add_argument("-f", "--force", action="store_true", help="force delete (dangerous!)")
|
|
44
|
+
parser.add_argument("-v", "--verbose", action="store_true", help="print extra details")
|
|
45
|
+
parser.add_argument("-q", "--quiet", action="store_true", help="do not print anything, except errors")
|
|
46
|
+
|
|
47
|
+
def parse_arguments():
|
|
48
|
+
parser = argparse.ArgumentParser(description="Clean up current directory")
|
|
49
|
+
add_arguments(parser)
|
|
50
|
+
return parser.parse_args()
|
|
51
|
+
|
|
52
|
+
######################################
|
|
53
|
+
# Helper Functions
|
|
54
|
+
######################################
|
|
55
|
+
|
|
56
|
+
def remove_path(path, force=False, verbose=False, quiet=False):
|
|
57
|
+
|
|
58
|
+
cwd = os.getcwd()
|
|
59
|
+
full_path = os.path.realpath(os.path.join(cwd, path))
|
|
60
|
+
|
|
61
|
+
if path in DANGEROUS_PATHS or full_path in DANGEROUS_PATHS:
|
|
62
|
+
if not force:
|
|
63
|
+
if not quiet:
|
|
64
|
+
printc.warning("Deleting \"" + full_path + "\" seams dangerous! Use --force to force deletion (use at your own risks!)", script_name=script_name)
|
|
65
|
+
return
|
|
66
|
+
|
|
67
|
+
# Handle asterisks
|
|
68
|
+
paths_to_remove = glob.glob(full_path)
|
|
69
|
+
|
|
70
|
+
# Check if the lis is empty
|
|
71
|
+
if not paths_to_remove:
|
|
72
|
+
if verbose:
|
|
73
|
+
printc.warning("Path \"" + full_path + "\" does not exist or is not accessible.", script_name=script_name)
|
|
74
|
+
return
|
|
75
|
+
|
|
76
|
+
# Remove path
|
|
77
|
+
for p in paths_to_remove:
|
|
78
|
+
try:
|
|
79
|
+
if os.path.isfile(p) or os.path.islink(p):
|
|
80
|
+
os.remove(p)
|
|
81
|
+
if not quiet:
|
|
82
|
+
printc.say("Removed \"" + p + "\" (file)", script_name=script_name)
|
|
83
|
+
elif os.path.isdir(p):
|
|
84
|
+
shutil.rmtree(p)
|
|
85
|
+
if not quiet:
|
|
86
|
+
printc.say("Removed \"" + p + "\" (directory)", script_name=script_name)
|
|
87
|
+
else:
|
|
88
|
+
if verbose:
|
|
89
|
+
printc.warning("Path \"" + p + "\" does not exist or is not accessible.", script_name=script_name)
|
|
90
|
+
except Exception as e:
|
|
91
|
+
printc.error("Failed to remove \"" + p + "\".", script_name=script_name)
|
|
92
|
+
printc.cyan("error details: ", end="", script_name=script_name)
|
|
93
|
+
print(str(e))
|
|
94
|
+
|
|
95
|
+
######################################
|
|
96
|
+
# Clean
|
|
97
|
+
######################################
|
|
98
|
+
|
|
99
|
+
def clean(settings_filename, force=False, verbose=False, quiet=False):
|
|
100
|
+
if not os.path.isfile(settings_filename):
|
|
101
|
+
if not quiet:
|
|
102
|
+
printc.note("There is no clean settings file \"" + settings_filename + "\" in \"" + os.path.realpath(".") + "\". Using default Odatix clean settings file", script_name)
|
|
103
|
+
settings_filename = os.path.join(OdatixSettings.odatix_path, OdatixSettings.DEFAULT_CLEAN_SETTINGS_FILE)
|
|
104
|
+
if not os.path.isfile(settings_filename):
|
|
105
|
+
printc.error("There is no default Odatix clean settings file \"" + settings_filename, script_name)
|
|
106
|
+
sys.exit(-1)
|
|
107
|
+
with open(settings_filename, "r") as f:
|
|
108
|
+
try:
|
|
109
|
+
settings_data = yaml.load(f, Loader=yaml.loader.SafeLoader)
|
|
110
|
+
except Exception as e:
|
|
111
|
+
printc.error("Settings file \"" + settings_filename + "\" is not a valid YAML file", script_name)
|
|
112
|
+
printc.cyan("error details: ", end="", script_name=script_name)
|
|
113
|
+
print(str(e))
|
|
114
|
+
sys.exit(-1)
|
|
115
|
+
try:
|
|
116
|
+
remove_list = read_from_list("remove_list", settings_data, settings_filename, script_name=script_name)
|
|
117
|
+
except (KeyNotInListError, BadValueInListError):
|
|
118
|
+
sys.exit(-1)
|
|
119
|
+
|
|
120
|
+
if not isinstance(remove_list, list):
|
|
121
|
+
printc.error("\"remove_list\" from settings file \"" + settings_filename + "\" is not a list", script_name)
|
|
122
|
+
printc.note("Are you missing dashes (-)?", script_name)
|
|
123
|
+
sys.exit(-1)
|
|
124
|
+
|
|
125
|
+
for path in remove_list:
|
|
126
|
+
remove_path(path, force, verbose, quiet)
|
|
127
|
+
|
|
128
|
+
######################################
|
|
129
|
+
# Main
|
|
130
|
+
######################################
|
|
131
|
+
|
|
132
|
+
def main(args):
|
|
133
|
+
clean(
|
|
134
|
+
settings_filename=args.input,
|
|
135
|
+
force=args.force,
|
|
136
|
+
verbose=args.verbose,
|
|
137
|
+
quiet=args.quiet
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
if __name__ == "__main__":
|
|
141
|
+
args = parse_arguments()
|
|
142
|
+
main(args)
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# ********************************************************************** #
|
|
2
|
+
# Odatix #
|
|
3
|
+
# ********************************************************************** #
|
|
4
|
+
#
|
|
5
|
+
# Copyright (C) 2022 Jonathan Saussereau
|
|
6
|
+
#
|
|
7
|
+
# This file is part of Odatix.
|
|
8
|
+
# Odatix is free software: you can redistribute it and/or modify
|
|
9
|
+
# it under the terms of the GNU General Public License as published by
|
|
10
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
# (at your option) any later version.
|
|
12
|
+
#
|
|
13
|
+
# Odatix is distributed in the hope that it will be useful,
|
|
14
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
# GNU General Public License for more details.
|
|
17
|
+
#
|
|
18
|
+
# You should have received a copy of the GNU General Public License
|
|
19
|
+
# along with Odatix. If not, see <https://www.gnu.org/licenses/>.
|
|
20
|
+
#
|
|
21
|
+
|
|
22
|
+
import os
|
|
23
|
+
import re
|
|
24
|
+
import sys
|
|
25
|
+
import yaml
|
|
26
|
+
import argparse
|
|
27
|
+
|
|
28
|
+
from odatix.lib.settings import OdatixSettings
|
|
29
|
+
import odatix.lib.re_helper as rh
|
|
30
|
+
import odatix.lib.printc as printc
|
|
31
|
+
|
|
32
|
+
######################################
|
|
33
|
+
# Settings
|
|
34
|
+
######################################
|
|
35
|
+
|
|
36
|
+
DEFAULT_BENCHMARK = "dhrystone"
|
|
37
|
+
DEFAULT_SIM_FILE = "log/sim.log"
|
|
38
|
+
|
|
39
|
+
status_done = 'Done: 100%'
|
|
40
|
+
|
|
41
|
+
script_name = os.path.basename(__file__)
|
|
42
|
+
|
|
43
|
+
dmips_per_mhz_pattern = re.compile("(.*)DMIPS_Per_MHz: ([0-9.]+)")
|
|
44
|
+
bad_value = None
|
|
45
|
+
|
|
46
|
+
######################################
|
|
47
|
+
# Parse Arguments
|
|
48
|
+
######################################
|
|
49
|
+
|
|
50
|
+
def add_arguments(parser):
|
|
51
|
+
parser.add_argument('-b', '--benchmark', default=DEFAULT_BENCHMARK, help='benchmark to parse (default: ' + DEFAULT_BENCHMARK + ')')
|
|
52
|
+
parser.add_argument('-S', '--sim_file', default=DEFAULT_SIM_FILE, help='simulation log file (default: ' + DEFAULT_SIM_FILE + ')')
|
|
53
|
+
parser.add_argument('-B', '--benchmark_file', help='output benchmark file')
|
|
54
|
+
parser.add_argument('-w', '--work', help='simulation work directory')
|
|
55
|
+
parser.add_argument('-c', '--config', default=OdatixSettings.DEFAULT_SETTINGS_FILE, help='global settings file for Odatix (default: ' + OdatixSettings.DEFAULT_SETTINGS_FILE + ')')
|
|
56
|
+
|
|
57
|
+
def parse_arguments():
|
|
58
|
+
parser = argparse.ArgumentParser(description='Process benchmark results')
|
|
59
|
+
add_arguments(parser)
|
|
60
|
+
return parser.parse_args()
|
|
61
|
+
|
|
62
|
+
######################################
|
|
63
|
+
# Misc functions
|
|
64
|
+
######################################
|
|
65
|
+
|
|
66
|
+
def corrupted_directory(variant):
|
|
67
|
+
printc.warning(variant + " => synthesis has not finished or directory has been corrupted", script_name)
|
|
68
|
+
|
|
69
|
+
def safe_cast(val, to_type, default=None):
|
|
70
|
+
try:
|
|
71
|
+
return to_type(val)
|
|
72
|
+
except (ValueError, TypeError):
|
|
73
|
+
return default
|
|
74
|
+
|
|
75
|
+
######################################
|
|
76
|
+
# Parsing functions
|
|
77
|
+
######################################
|
|
78
|
+
|
|
79
|
+
def get_dmips_per_mhz(file):
|
|
80
|
+
return rh.get_re_group_from_file(file, dmips_per_mhz_pattern, group_id=2)
|
|
81
|
+
|
|
82
|
+
######################################
|
|
83
|
+
# Format functions
|
|
84
|
+
######################################
|
|
85
|
+
|
|
86
|
+
def cast_to_int(input):
|
|
87
|
+
if input == bad_value:
|
|
88
|
+
return '/'
|
|
89
|
+
else:
|
|
90
|
+
return safe_cast(input, int, 0)
|
|
91
|
+
|
|
92
|
+
def cast_to_float(input):
|
|
93
|
+
if input == bad_value:
|
|
94
|
+
return '/'
|
|
95
|
+
else:
|
|
96
|
+
return safe_cast(input, float, 0.0)
|
|
97
|
+
|
|
98
|
+
def write_to_yaml(input, sim_file, output_file):
|
|
99
|
+
yaml_data = {}
|
|
100
|
+
|
|
101
|
+
for arch in sorted(next(os.walk(input))[1]):
|
|
102
|
+
yaml_data[arch] = {}
|
|
103
|
+
for variant in sorted(next(os.walk(os.path.join(input, arch)))[1]):
|
|
104
|
+
cur_path = os.path.join(input, arch, variant)
|
|
105
|
+
cur_sim_file = os.path.join(cur_path, sim_file)
|
|
106
|
+
|
|
107
|
+
if not os.path.exists(cur_sim_file):
|
|
108
|
+
corrupted_directory(arch + '/' + variant)
|
|
109
|
+
continue
|
|
110
|
+
|
|
111
|
+
dmips_per_mhz = get_dmips_per_mhz(cur_sim_file)
|
|
112
|
+
dmips_per_mhz = cast_to_float(dmips_per_mhz) if dmips_per_mhz != ' / ' else ""
|
|
113
|
+
yaml_data[arch][variant] = {
|
|
114
|
+
'DMIPS_per_MHz': dmips_per_mhz,
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
output_path = os.path.dirname(output_file)
|
|
118
|
+
if not os.path.exists(output_path):
|
|
119
|
+
os.makedirs(output_path, exist_ok=True)
|
|
120
|
+
try:
|
|
121
|
+
with open(output_file, 'w') as file:
|
|
122
|
+
yaml.dump(yaml_data, file, default_flow_style=False, sort_keys=False)
|
|
123
|
+
printc.say("Results written to \"" + output_file + "\"", script_name=script_name)
|
|
124
|
+
except Exception as e:
|
|
125
|
+
printc.error("Could not write results to \"" + output_file + "\"", script_name=script_name)
|
|
126
|
+
printc.cyan("error details: ", end="", script_name=script_name)
|
|
127
|
+
print(str(e))
|
|
128
|
+
|
|
129
|
+
######################################
|
|
130
|
+
# Export Results
|
|
131
|
+
######################################
|
|
132
|
+
|
|
133
|
+
def export_benchmark(input, output, benchmark, sim_file):
|
|
134
|
+
print(printc.colors.CYAN + "Export " + benchmark + " results" + printc.colors.ENDC)
|
|
135
|
+
input = os.path.join(input, benchmark)
|
|
136
|
+
if not os.path.isdir(input):
|
|
137
|
+
printc.error("input directory \"" + input + "\" does not exist", script_name)
|
|
138
|
+
sys.exit(1)
|
|
139
|
+
|
|
140
|
+
#if format in ['yml']:
|
|
141
|
+
write_to_yaml(input, sim_file, output)
|
|
142
|
+
|
|
143
|
+
print()
|
|
144
|
+
|
|
145
|
+
######################################
|
|
146
|
+
# Main
|
|
147
|
+
######################################
|
|
148
|
+
|
|
149
|
+
def main(args, settings=None):
|
|
150
|
+
|
|
151
|
+
# Get settings
|
|
152
|
+
if settings is None:
|
|
153
|
+
settings = OdatixSettings(args.config)
|
|
154
|
+
if not settings.valid:
|
|
155
|
+
sys.exit(-1)
|
|
156
|
+
|
|
157
|
+
if args.benchmark_file is not None:
|
|
158
|
+
benchmark_file = args.benchmark_file
|
|
159
|
+
else:
|
|
160
|
+
benchmark_file = settings.benchmark_file
|
|
161
|
+
|
|
162
|
+
if args.work is not None:
|
|
163
|
+
work = args.work
|
|
164
|
+
else:
|
|
165
|
+
work = settings.sim_work_path
|
|
166
|
+
|
|
167
|
+
export_benchmark(
|
|
168
|
+
input=work,
|
|
169
|
+
output=benchmark_file,
|
|
170
|
+
benchmark=args.benchmark,
|
|
171
|
+
sim_file=args.sim_file
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
if __name__ == "__main__":
|
|
175
|
+
args = parse_arguments()
|
|
176
|
+
main(args)
|