From 5b30fb7328adee86eb16a58483cf4650b5ee7392 Mon Sep 17 00:00:00 2001 From: Shreya Sanghai Date: Sun, 27 Feb 2022 09:50:10 +0000 Subject: [PATCH 1/4] added make allsynth --- synthDC/Makefile | 70 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 53 insertions(+), 17 deletions(-) diff --git a/synthDC/Makefile b/synthDC/Makefile index aa148802..ddbf5c0f 100755 --- a/synthDC/Makefile +++ b/synthDC/Makefile @@ -24,9 +24,10 @@ export SAIFPOWER ?= 0 CONFIGDIR ?= ~/riscv-wally/pipelined/config #CONFIGS ?= $(shell find $(CONFIGDIR) -name "rv*") CONFIGS ?= ("rv32e", "rv32ic") - +CONFIGFILES ?= $(shell find $(CONFIGDIR) -name *_*) +CONFIGFILESTRIM = $(notdir $(CONFIGFILES)) print: - echo "files in $(CONFIGDIR) are $(CONFIGS)." + echo $(CONFIGFILESTRIM) default: @echo "Basic synthesis procedure for Wally:" @@ -38,22 +39,57 @@ test: rv% rv%.log: rv% echo $< -flavors: - rm -rf $(CONFIGDIR)/rv32em - cp -r $(CONFIGDIR)/rv32e $(CONFIGDIR)/rv32em - sed -i 's/h00000010/h00001010/' $(CONFIGDIR)/rv32em/wally-config.vh - # rv32e, 32ic, 32gc 64ic, 64gc - # 64gc - FPU - # PMP16 - # PMP0 - # No virtual memory - # Muldiv - -allsynth: - make flavors - make synth DESIGN=wallypipelinedcore CONFIG=rv32e TECH=sky90 FREQ=500 MAXCORES=1 - make synth DESIGN=wallypipelinedcore CONFIG=rv32em TECH=sky90 FREQ=500 MAXCORES=1 +DIRS = rv32e #rv32gc rv64ic rv64gc rv32ic +CONFIGSUBDIRS = _FPUoff _noMulDiv _noVirtMem _PMP0 _PMP16 _orig +CONFIGFILES ?= $(shell find $(CONFIGDIR) -type d -regex "*_*") +del: + @$(foreach dir, $(DIRS), rm -rf $(CONFIGDIR)/$(dir)_orig;) + @$(foreach dir, $(DIRS), rm -rf $(CONFIGDIR)/$(dir)_FPUoff;) + @$(foreach dir, $(DIRS), rm -rf $(CONFIGDIR)/$(dir)_PMP16;) + @$(foreach dir, $(DIRS), rm -rf $(CONFIGDIR)/$(dir)_PMP0;) + @$(foreach dir, $(DIRS), rm -rf $(CONFIGDIR)/$(dir)_noVirtMem;) + @$(foreach dir, $(DIRS), rm -rf $(CONFIGDIR)/$(dir)_noMulDiv;) + +configs: + # @$(foreach dir, $(DIRS), rm -rf $(CONFIGDIR)/$(dir)_orig;) + # @$(foreach dir, $(DIRS), cp -r $(CONFIGDIR)/$(dir) $(CONFIGDIR)/$(dir)_orig;) + # turn off FPU + @$(foreach dir, $(DIRS), rm -rf $(CONFIGDIR)/$(dir)_FPUoff;) + @$(foreach dir, $(DIRS), cp -r $(CONFIGDIR)/$(dir) $(CONFIGDIR)/$(dir)_FPUoff;) + @$(foreach dir, $(DIRS), sed -i 's/1 *<< *3/0 << 3/' $(CONFIGDIR)/$(dir)_FPUoff/wally-config.vh;) + @$(foreach dir, $(DIRS), sed -i 's/1 *<< *5/0 << 5/' $(CONFIGDIR)/$(dir)_FPUoff/wally-config.vh;) + + # PMP 16 + @$(foreach dir, $(DIRS), rm -rf $(CONFIGDIR)/$(dir)_PMP16;) + @$(foreach dir, $(DIRS), cp -r $(CONFIGDIR)/$(dir) $(CONFIGDIR)/$(dir)_PMP16;) + @$(foreach dir, $(DIRS), sed -i 's/PMP_ENTRIES \(64\|16\|0\)/PMP_ENTRIES 16/' $(CONFIGDIR)/$(dir)_PMP16/wally-config.vh;) + + # PMP 0 + @$(foreach dir, $(DIRS), rm -rf $(CONFIGDIR)/$(dir)_PMP0;) + @$(foreach dir, $(DIRS), cp -r $(CONFIGDIR)/$(dir) $(CONFIGDIR)/$(dir)_PMP0;) + @$(foreach dir, $(DIRS), sed -i 's/PMP_ENTRIES \(64\|16\|0\)/PMP_ENTRIES 0/' $(CONFIGDIR)/$(dir)_PMP0/wally-config.vh;) + + # No Virtual Memory + @$(foreach dir, $(DIRS), rm -rf $(CONFIGDIR)/$(dir)_noVirtMem;) + @$(foreach dir, $(DIRS), cp -r $(CONFIGDIR)/$(dir) $(CONFIGDIR)/$(dir)_noVirtMem;) + @$(foreach dir, $(DIRS), sed -i 's/VIRTMEM_SUPPORTED 1/VIRTMEM_SUPPORTED 0/' $(CONFIGDIR)/$(dir)_noVirtMem/wally-config.vh;) + + #no muldiv + @$(foreach dir, $(DIRS), rm -rf $(CONFIGDIR)/$(dir)_noMulDiv;) + @$(foreach dir, $(DIRS), cp -r $(CONFIGDIR)/$(dir) $(CONFIGDIR)/$(dir)_noMulDiv;) + @$(foreach dir, $(DIRS), sed -i 's/1 *<< *12/0 << 12/' $(CONFIGDIR)/$(dir)_noMulDiv/wally-config.vh;) + + +# allsynth: +# make configs +# $(foreach dir, $(CONFIGFILESTRIM), \ +# make synth DESIGN=wallypipelinedcore CONFIG=$(dir) TECH=sky90 FREQ=500 --jobs;) + +allsynth: $(CONFIGFILESTRIM) + +$(CONFIGFILESTRIM): + make synth DESIGN=wallypipelinedcore CONFIG=$@ TECH=sky90 FREQ=500 --jobs synth: @echo "DC Synthesis" From db38b69f830ff4439824e9e6774145164a1eb298 Mon Sep 17 00:00:00 2001 From: Shreya Sanghai Date: Mon, 28 Feb 2022 17:14:56 +0000 Subject: [PATCH 2/4] Makefile for running multiple synthesis --- synthDC/Makefile | 67 +++++++++++++++++++++------------------ synthDC/extractSummary.py | 25 +++++++++++++++ 2 files changed, 61 insertions(+), 31 deletions(-) create mode 100644 synthDC/extractSummary.py diff --git a/synthDC/Makefile b/synthDC/Makefile index ddbf5c0f..f0096c73 100755 --- a/synthDC/Makefile +++ b/synthDC/Makefile @@ -22,9 +22,7 @@ export OUTPUTDIR := runs/$(DESIGN)_$(CONFIG)_$(TECH)nm_$(FREQ)_MHz_$(time)_$(has export SAIFPOWER ?= 0 CONFIGDIR ?= ~/riscv-wally/pipelined/config -#CONFIGS ?= $(shell find $(CONFIGDIR) -name "rv*") -CONFIGS ?= ("rv32e", "rv32ic") -CONFIGFILES ?= $(shell find $(CONFIGDIR) -name *_*) +CONFIGFILES ?= $(shell find $(CONFIGDIR) -name rv*_*) CONFIGFILESTRIM = $(notdir $(CONFIGFILES)) print: echo $(CONFIGFILESTRIM) @@ -40,9 +38,11 @@ rv%.log: rv% echo $< -DIRS = rv32e #rv32gc rv64ic rv64gc rv32ic +DIRS = rv32e rv32gc rv64ic rv64gc rv32ic +DELDIRS = rv32e rv32gc rv64ic rv64gc rv32ic CONFIGSUBDIRS = _FPUoff _noMulDiv _noVirtMem _PMP0 _PMP16 _orig -CONFIGFILES ?= $(shell find $(CONFIGDIR) -type d -regex "*_*") + + del: @$(foreach dir, $(DIRS), rm -rf $(CONFIGDIR)/$(dir)_orig;) @$(foreach dir, $(DIRS), rm -rf $(CONFIGDIR)/$(dir)_FPUoff;) @@ -51,45 +51,50 @@ del: @$(foreach dir, $(DIRS), rm -rf $(CONFIGDIR)/$(dir)_noVirtMem;) @$(foreach dir, $(DIRS), rm -rf $(CONFIGDIR)/$(dir)_noMulDiv;) -configs: - # @$(foreach dir, $(DIRS), rm -rf $(CONFIGDIR)/$(dir)_orig;) - # @$(foreach dir, $(DIRS), cp -r $(CONFIGDIR)/$(dir) $(CONFIGDIR)/$(dir)_orig;) - # turn off FPU - @$(foreach dir, $(DIRS), rm -rf $(CONFIGDIR)/$(dir)_FPUoff;) - @$(foreach dir, $(DIRS), cp -r $(CONFIGDIR)/$(dir) $(CONFIGDIR)/$(dir)_FPUoff;) - @$(foreach dir, $(DIRS), sed -i 's/1 *<< *3/0 << 3/' $(CONFIGDIR)/$(dir)_FPUoff/wally-config.vh;) - @$(foreach dir, $(DIRS), sed -i 's/1 *<< *5/0 << 5/' $(CONFIGDIR)/$(dir)_FPUoff/wally-config.vh;) +configs: $(DIRS) +$(DIRS): + #turn off FPU + rm -rf $(CONFIGDIR)/$@_FPUoff + cp -r $(CONFIGDIR)/$@ $(CONFIGDIR)/$@_FPUoff + sed -i 's/1 *<< *3/0 << 3/' $(CONFIGDIR)/$@_FPUoff/wally-config.vh + sed -i 's/1 *<< *5/0 << 5/' $(CONFIGDIR)/$@_FPUoff/wally-config.vh # PMP 16 - @$(foreach dir, $(DIRS), rm -rf $(CONFIGDIR)/$(dir)_PMP16;) - @$(foreach dir, $(DIRS), cp -r $(CONFIGDIR)/$(dir) $(CONFIGDIR)/$(dir)_PMP16;) - @$(foreach dir, $(DIRS), sed -i 's/PMP_ENTRIES \(64\|16\|0\)/PMP_ENTRIES 16/' $(CONFIGDIR)/$(dir)_PMP16/wally-config.vh;) + rm -rf $(CONFIGDIR)/$@_PMP16 + cp -r $(CONFIGDIR)/$@ $(CONFIGDIR)/$@_PMP16 + sed -i 's/1 *<< *3/0 << 3/' $(CONFIGDIR)/$@_PMP16/wally-config.vh + sed -i 's/1 *<< *5/0 << 5/' $(CONFIGDIR)/$@_PMP16/wally-config.vh + sed -i 's/PMP_ENTRIES \(64\|16\|0\)/PMP_ENTRIES 16/' $(CONFIGDIR)/$@_PMP16/wally-config.vh # PMP 0 - @$(foreach dir, $(DIRS), rm -rf $(CONFIGDIR)/$(dir)_PMP0;) - @$(foreach dir, $(DIRS), cp -r $(CONFIGDIR)/$(dir) $(CONFIGDIR)/$(dir)_PMP0;) - @$(foreach dir, $(DIRS), sed -i 's/PMP_ENTRIES \(64\|16\|0\)/PMP_ENTRIES 0/' $(CONFIGDIR)/$(dir)_PMP0/wally-config.vh;) + rm -rf $(CONFIGDIR)/$@_PMP0 + cp -r $(CONFIGDIR)/$@ $(CONFIGDIR)/$@_PMP0 + sed -i 's/1 *<< *3/0 << 3/' $(CONFIGDIR)/$@_PMP0/wally-config.vh + sed -i 's/1 *<< *5/0 << 5/' $(CONFIGDIR)/$@_PMP0/wally-config.vh + sed -i 's/PMP_ENTRIES \(64\|16\|0\)/PMP_ENTRIES 0/' $(CONFIGDIR)/$@_PMP0/wally-config.vh # No Virtual Memory - @$(foreach dir, $(DIRS), rm -rf $(CONFIGDIR)/$(dir)_noVirtMem;) - @$(foreach dir, $(DIRS), cp -r $(CONFIGDIR)/$(dir) $(CONFIGDIR)/$(dir)_noVirtMem;) - @$(foreach dir, $(DIRS), sed -i 's/VIRTMEM_SUPPORTED 1/VIRTMEM_SUPPORTED 0/' $(CONFIGDIR)/$(dir)_noVirtMem/wally-config.vh;) + rm -rf $(CONFIGDIR)/$@_noVirtMem + cp -r $(CONFIGDIR)/$@ $(CONFIGDIR)/$@_noVirtMem + sed -i 's/1 *<< *3/0 << 3/' $(CONFIGDIR)/$@_noVirtMem/wally-config.vh + sed -i 's/1 *<< *5/0 << 5/' $(CONFIGDIR)/$@_noVirtMem/wally-config.vh + sed -i 's/PMP_ENTRIES \(64\|16\|0\)/PMP_ENTRIES 0/' $(CONFIGDIR)/$@_noVirtMem/wally-config.vh + sed -i 's/VIRTMEM_SUPPORTED 1/VIRTMEM_SUPPORTED 0/' $(CONFIGDIR)/$@_noVirtMem/wally-config.vh #no muldiv - @$(foreach dir, $(DIRS), rm -rf $(CONFIGDIR)/$(dir)_noMulDiv;) - @$(foreach dir, $(DIRS), cp -r $(CONFIGDIR)/$(dir) $(CONFIGDIR)/$(dir)_noMulDiv;) - @$(foreach dir, $(DIRS), sed -i 's/1 *<< *12/0 << 12/' $(CONFIGDIR)/$(dir)_noMulDiv/wally-config.vh;) + rm -rf $(CONFIGDIR)/$@_noMulDiv + cp -r $(CONFIGDIR)/$@ $(CONFIGDIR)/$@_noMulDiv + sed -i 's/1 *<< *3/0 << 3/' $(CONFIGDIR)/$@_noMulDiv/wally-config.vh + sed -i 's/1 *<< *5/0 << 5/' $(CONFIGDIR)/$@_noMulDiv/wally-config.vh + sed -i 's/PMP_ENTRIES \(64\|16\|0\)/PMP_ENTRIES 0/' $(CONFIGDIR)/$@_noMulDiv/wally-config.vh + sed -i 's/VIRTMEM_SUPPORTED 1/VIRTMEM_SUPPORTED 0/' $(CONFIGDIR)/$@_noMulDiv/wally-config.vh + sed -i 's/1 *<< *12/0 << 12/' $(CONFIGDIR)/$@_noMulDiv/wally-config.vh -# allsynth: -# make configs -# $(foreach dir, $(CONFIGFILESTRIM), \ -# make synth DESIGN=wallypipelinedcore CONFIG=$(dir) TECH=sky90 FREQ=500 --jobs;) - allsynth: $(CONFIGFILESTRIM) $(CONFIGFILESTRIM): - make synth DESIGN=wallypipelinedcore CONFIG=$@ TECH=sky90 FREQ=500 --jobs + make synth DESIGN=wallypipelinedcore CONFIG=$@ TECH=sky90 FREQ=500 MAXCORES=1 --jobs synth: @echo "DC Synthesis" diff --git a/synthDC/extractSummary.py b/synthDC/extractSummary.py new file mode 100644 index 00000000..2a780660 --- /dev/null +++ b/synthDC/extractSummary.py @@ -0,0 +1,25 @@ +import glob +import re +import csv + +field_names = [ 'Name', 'Critical Path Length', 'Cell Area'] +data = [] +for name in glob.glob("/home/ssanghai/riscv-wally/synthDC/runs/*/reports/wallypipelinedcore_qor.rep"): + f = open(name, 'r') + trimName = re.search("runs\/(.*?)\/reports", name).group(1) + # trimName = re.search("wallypipelinedcore_(.*?)_sky9",name).group(1) + for line in f: + if "Critical Path Length" in line: + pathLen = re.search("Length: *(.*?)\\n", line).group(1) + if "Cell Area" in line: + area = re.search("Area: *(.*?)\\n", line).group(1) + data += [{'Name' : trimName, 'Critical Path Length': pathLen, 'Cell Area' : area}] + +with open('Summary.csv', 'w') as csvfile: + writer = csv.DictWriter(csvfile, fieldnames=field_names) + writer.writeheader() + writer.writerows(data) + + + + \ No newline at end of file From 06c2744ac1532b96ba470590459538b55ce1c3e0 Mon Sep 17 00:00:00 2001 From: Shreya Sanghai Date: Mon, 28 Feb 2022 17:32:08 +0000 Subject: [PATCH 3/4] Copied previous cofig file instead of orig --- synthDC/Makefile | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/synthDC/Makefile b/synthDC/Makefile index f0096c73..aafadb64 100755 --- a/synthDC/Makefile +++ b/synthDC/Makefile @@ -39,8 +39,8 @@ rv%.log: rv% DIRS = rv32e rv32gc rv64ic rv64gc rv32ic -DELDIRS = rv32e rv32gc rv64ic rv64gc rv32ic -CONFIGSUBDIRS = _FPUoff _noMulDiv _noVirtMem _PMP0 _PMP16 _orig +# DELDIRS = rv32e rv32gc rv64ic rv64gc rv32ic +# CONFIGSUBDIRS = _FPUoff _noMulDiv _noVirtMem _PMP0 _PMP16 _orig del: @@ -61,33 +61,33 @@ $(DIRS): # PMP 16 rm -rf $(CONFIGDIR)/$@_PMP16 - cp -r $(CONFIGDIR)/$@ $(CONFIGDIR)/$@_PMP16 - sed -i 's/1 *<< *3/0 << 3/' $(CONFIGDIR)/$@_PMP16/wally-config.vh - sed -i 's/1 *<< *5/0 << 5/' $(CONFIGDIR)/$@_PMP16/wally-config.vh + cp -r $(CONFIGDIR)/$@_FPUoff $(CONFIGDIR)/$@_PMP16 + # sed -i 's/1 *<< *3/0 << 3/' $(CONFIGDIR)/$@_PMP16/wally-config.vh + # sed -i 's/1 *<< *5/0 << 5/' $(CONFIGDIR)/$@_PMP16/wally-config.vh sed -i 's/PMP_ENTRIES \(64\|16\|0\)/PMP_ENTRIES 16/' $(CONFIGDIR)/$@_PMP16/wally-config.vh # PMP 0 rm -rf $(CONFIGDIR)/$@_PMP0 - cp -r $(CONFIGDIR)/$@ $(CONFIGDIR)/$@_PMP0 - sed -i 's/1 *<< *3/0 << 3/' $(CONFIGDIR)/$@_PMP0/wally-config.vh - sed -i 's/1 *<< *5/0 << 5/' $(CONFIGDIR)/$@_PMP0/wally-config.vh + cp -r $(CONFIGDIR)/$@_FPUoff $(CONFIGDIR)/$@_PMP0 + # sed -i 's/1 *<< *3/0 << 3/' $(CONFIGDIR)/$@_PMP0/wally-config.vh + # sed -i 's/1 *<< *5/0 << 5/' $(CONFIGDIR)/$@_PMP0/wally-config.vh sed -i 's/PMP_ENTRIES \(64\|16\|0\)/PMP_ENTRIES 0/' $(CONFIGDIR)/$@_PMP0/wally-config.vh # No Virtual Memory rm -rf $(CONFIGDIR)/$@_noVirtMem - cp -r $(CONFIGDIR)/$@ $(CONFIGDIR)/$@_noVirtMem - sed -i 's/1 *<< *3/0 << 3/' $(CONFIGDIR)/$@_noVirtMem/wally-config.vh - sed -i 's/1 *<< *5/0 << 5/' $(CONFIGDIR)/$@_noVirtMem/wally-config.vh - sed -i 's/PMP_ENTRIES \(64\|16\|0\)/PMP_ENTRIES 0/' $(CONFIGDIR)/$@_noVirtMem/wally-config.vh + # cp -r $(CONFIGDIR)/$@ $(CONFIGDIR)/$@_noVirtMem + # sed -i 's/1 *<< *3/0 <_PMP0< 3/' $(CONFIGDIR)/$@_noVirtMem/wally-config.vh + # sed -i 's/1 *<< *5/0 << 5/' $(CONFIGDIR)/$@_noVirtMem/wally-config.vh + # sed -i 's/PMP_ENTRIES \(64\|16\|0\)/PMP_ENTRIES 0/' $(CONFIGDIR)/$@_noVirtMem/wally-config.vh sed -i 's/VIRTMEM_SUPPORTED 1/VIRTMEM_SUPPORTED 0/' $(CONFIGDIR)/$@_noVirtMem/wally-config.vh #no muldiv rm -rf $(CONFIGDIR)/$@_noMulDiv - cp -r $(CONFIGDIR)/$@ $(CONFIGDIR)/$@_noMulDiv - sed -i 's/1 *<< *3/0 << 3/' $(CONFIGDIR)/$@_noMulDiv/wally-config.vh - sed -i 's/1 *<< *5/0 << 5/' $(CONFIGDIR)/$@_noMulDiv/wally-config.vh - sed -i 's/PMP_ENTRIES \(64\|16\|0\)/PMP_ENTRIES 0/' $(CONFIGDIR)/$@_noMulDiv/wally-config.vh - sed -i 's/VIRTMEM_SUPPORTED 1/VIRTMEM_SUPPORTED 0/' $(CONFIGDIR)/$@_noMulDiv/wally-config.vh + cp -r $(CONFIGDIR)/$@_noVirtMem $(CONFIGDIR)/$@_noMulDiv + # sed -i 's/1 *<< *3/0 << 3/' $(CONFIGDIR)/$@_noMulDiv/wally-config.vh + # sed -i 's/1 *<< *5/0 << 5/' $(CONFIGDIR)/$@_noMulDiv/wally-config.vh + # sed -i 's/PMP_ENTRIES \(64\|16\|0\)/PMP_ENTRIES 0/' $(CONFIGDIR)/$@_noMulDiv/wally-config.vh + # sed -i 's/VIRTMEM_SUPPORTED 1/VIRTMEM_SUPPORTED 0/' $(CONFIGDIR)/$@_noMulDiv/wally-config.vh sed -i 's/1 *<< *12/0 << 12/' $(CONFIGDIR)/$@_noMulDiv/wally-config.vh From 6a1f1e249638b1728a27bb2867bfdeee757110f1 Mon Sep 17 00:00:00 2001 From: Shreya Sanghai Date: Mon, 28 Feb 2022 17:33:15 +0000 Subject: [PATCH 4/4] changed filename --- synthDC/extractSummary.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/synthDC/extractSummary.py b/synthDC/extractSummary.py index 2a780660..e9fa6977 100644 --- a/synthDC/extractSummary.py +++ b/synthDC/extractSummary.py @@ -6,8 +6,8 @@ field_names = [ 'Name', 'Critical Path Length', 'Cell Area'] data = [] for name in glob.glob("/home/ssanghai/riscv-wally/synthDC/runs/*/reports/wallypipelinedcore_qor.rep"): f = open(name, 'r') - trimName = re.search("runs\/(.*?)\/reports", name).group(1) - # trimName = re.search("wallypipelinedcore_(.*?)_sky9",name).group(1) + # trimName = re.search("runs\/(.*?)\/reports", name).group(1) + trimName = re.search("wallypipelinedcore_(.*?)_sky9",name).group(1) for line in f: if "Critical Path Length" in line: pathLen = re.search("Length: *(.*?)\\n", line).group(1)