Skip to content

Commit e5ec75c

Browse files
authored
feat: add adder_cin_global flag (#3)
1 parent 22dfd1d commit e5ec75c

File tree

4 files changed

+27
-5
lines changed

4 files changed

+27
-5
lines changed

parmys/parmys-plugin/parmys.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,8 @@ struct ParMYSPass : public Pass {
878878
global_args.exact_mults = -1;
879879
global_args.mults_ratio = -1.0;
880880

881+
set_default_config();
882+
881883
log_header(design, "Starting parmys pass.\n");
882884

883885
size_t argidx;
@@ -918,6 +920,10 @@ struct ParMYSPass : public Pass {
918920
global_args.mults_ratio = atof(args[++argidx].c_str());
919921
continue;
920922
}
923+
if (args[argidx] == "-adder_cin_global") {
924+
configuration.adder_cin_global = true;
925+
continue;
926+
}
921927
}
922928
extra_args(args, argidx, design);
923929

@@ -935,7 +941,6 @@ struct ParMYSPass : public Pass {
935941
}
936942

937943
mixer = new HardSoftLogicMixer();
938-
set_default_config();
939944

940945
if (global_args.mults_ratio >= 0.0 && global_args.mults_ratio <= 1.0) {
941946
delete mixer->_opts[MULTIPLY];

vtr_flow/misc/yosys/synthesis.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ techmap -map +/parmys/aldffe2dff.v
6666

6767
opt -full
6868

69-
parmys -a QQQ -nopass -c CCC YYY
69+
parmys -a QQQ -nopass -c CCC ADDERCINGLOBAL
7070

7171
opt -full
7272

vtr_flow/scripts/python_libs/vtr/parmys/parmys.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ def init_script_file(
5454
architecture_file_path,
5555
odin_config_full_path,
5656
include_dir='.',
57-
top_module='-auto-top'
57+
top_module='-auto-top',
58+
adder_cin_global=False
5859
):
5960
"""initializing the raw yosys script file"""
6061
# specify the input files type
@@ -74,6 +75,7 @@ def init_script_file(
7475
"QQQ": architecture_file_path,
7576
"SEARCHPATH": include_dir,
7677
"TOPMODULE": top_module,
78+
"ADDERCINGLOBAL": "-adder_cin_global" if adder_cin_global else ""
7779
},
7880
)
7981

@@ -227,6 +229,11 @@ def run(
227229
top_module = '-top ' + parmys_args['topmodule']
228230
del parmys_args['topmodule']
229231

232+
adder_cin_global = False
233+
if ('adder_cin_global' in parmys_args):
234+
adder_cin_global = parmys_args['adder_cin_global']
235+
del parmys_args['adder_cin_global']
236+
230237
odin_base_config = str(vtr.paths.odin_cfg_path)
231238

232239
# Copy the config file
@@ -251,7 +258,8 @@ def run(
251258
architecture_file_path,
252259
odin_config_full_path,
253260
include_dir=include_dir,
254-
top_module=top_module
261+
top_module=top_module,
262+
adder_cin_global=adder_cin_global
255263
)
256264

257265
# set the parser

vtr_flow/scripts/run_vtr_flow.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ def vtr_command_argparser(prog=None):
295295
help="Tells ODIN II the adder type used in this configuration",
296296
)
297297
odin.add_argument(
298-
"-adder_cin_global",
298+
"-adder_cin_global_odin",
299299
default=False,
300300
action="store_true",
301301
dest="adder_cin_global",
@@ -384,6 +384,14 @@ def vtr_command_argparser(prog=None):
384384
dest='searchpath',
385385
help='search path for verilog files'
386386
)
387+
parmys.add_argument(
388+
"-adder_cin_global",
389+
default=False,
390+
action="store_true",
391+
dest="adder_cin_global",
392+
help="Tells Parmys to connect the first cin in an adder/subtractor"
393+
+ "chain to a global gnd/vdd net.",
394+
)
387395
#
388396
# VPR arguments
389397
#
@@ -748,6 +756,7 @@ def process_parmys_args(args):
748756
parmys_args["parser"] = args.parser
749757
parmys_args["topmodule"] = args.topmodule
750758
parmys_args['searchpath'] = args.searchpath
759+
parmys_args["adder_cin_global"] = args.adder_cin_global
751760
return parmys_args
752761

753762

0 commit comments

Comments
 (0)