mirror of
https://github.com/openhwgroup/cvw.git
synced 2025-04-20 03:47:20 -04:00
Makefile for running multiple synthesis
This commit is contained in:
parent
76fbf6a82e
commit
9ca4fde35e
2 changed files with 61 additions and 31 deletions
|
@ -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"
|
||||
|
|
25
synthDC/extractSummary.py
Normal file
25
synthDC/extractSummary.py
Normal file
|
@ -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)
|
||||
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue