forked from Github_Repos/cvw
broke up ppa analysis and synthesis
This commit is contained in:
parent
2254a8218d
commit
dd0489b8ce
17
synthDC/Synopsys_stack_trace_12580.txt
Normal file
17
synthDC/Synopsys_stack_trace_12580.txt
Normal file
@ -0,0 +1,17 @@
|
||||
GNU gdb (GDB) Red Hat Enterprise Linux 8.2-16.el8
|
||||
Copyright (C) 2018 Free Software Foundation, Inc.
|
||||
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law.
|
||||
Type "show copying" and "show warranty" for details.
|
||||
This GDB was configured as "x86_64-redhat-linux-gnu".
|
||||
Type "show configuration" for configuration details.
|
||||
For bug reporting instructions, please see:
|
||||
<http://www.gnu.org/software/gdb/bugs/>.
|
||||
Find the GDB manual and other documentation resources online at:
|
||||
<http://www.gnu.org/software/gdb/documentation/>.
|
||||
|
||||
For help, type "help".
|
||||
Type "apropos word" to search for commands related to "word".
|
||||
Attaching to process 12580
|
||||
(gdb) (gdb) (gdb) (gdb)
|
17
synthDC/Synopsys_stack_trace_32764.txt
Normal file
17
synthDC/Synopsys_stack_trace_32764.txt
Normal file
@ -0,0 +1,17 @@
|
||||
GNU gdb (GDB) Red Hat Enterprise Linux 8.2-16.el8
|
||||
Copyright (C) 2018 Free Software Foundation, Inc.
|
||||
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law.
|
||||
Type "show copying" and "show warranty" for details.
|
||||
This GDB was configured as "x86_64-redhat-linux-gnu".
|
||||
Type "show configuration" for configuration details.
|
||||
For bug reporting instructions, please see:
|
||||
<http://www.gnu.org/software/gdb/bugs/>.
|
||||
Find the GDB manual and other documentation resources online at:
|
||||
<http://www.gnu.org/software/gdb/documentation/>.
|
||||
|
||||
For help, type "help".
|
||||
Type "apropos word" to search for commands related to "word".
|
||||
Attaching to process 32764
|
||||
(gdb) (gdb) (gdb) (gdb)
|
17
synthDC/Synopsys_stack_trace_57184.txt
Normal file
17
synthDC/Synopsys_stack_trace_57184.txt
Normal file
@ -0,0 +1,17 @@
|
||||
GNU gdb (GDB) Red Hat Enterprise Linux 8.2-16.el8
|
||||
Copyright (C) 2018 Free Software Foundation, Inc.
|
||||
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law.
|
||||
Type "show copying" and "show warranty" for details.
|
||||
This GDB was configured as "x86_64-redhat-linux-gnu".
|
||||
Type "show configuration" for configuration details.
|
||||
For bug reporting instructions, please see:
|
||||
<http://www.gnu.org/software/gdb/bugs/>.
|
||||
Find the GDB manual and other documentation resources online at:
|
||||
<http://www.gnu.org/software/gdb/documentation/>.
|
||||
|
||||
For help, type "help".
|
||||
Type "apropos word" to search for commands related to "word".
|
||||
Attaching to process 57184
|
||||
(gdb) (gdb) (gdb) (gdb)
|
17
synthDC/Synopsys_stack_trace_57185.txt
Normal file
17
synthDC/Synopsys_stack_trace_57185.txt
Normal file
@ -0,0 +1,17 @@
|
||||
GNU gdb (GDB) Red Hat Enterprise Linux 8.2-16.el8
|
||||
Copyright (C) 2018 Free Software Foundation, Inc.
|
||||
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law.
|
||||
Type "show copying" and "show warranty" for details.
|
||||
This GDB was configured as "x86_64-redhat-linux-gnu".
|
||||
Type "show configuration" for configuration details.
|
||||
For bug reporting instructions, please see:
|
||||
<http://www.gnu.org/software/gdb/bugs/>.
|
||||
Find the GDB manual and other documentation resources online at:
|
||||
<http://www.gnu.org/software/gdb/documentation/>.
|
||||
|
||||
For help, type "help".
|
||||
Type "apropos word" to search for commands related to "word".
|
||||
Attaching to process 57185
|
||||
(gdb) (gdb) (gdb) (gdb)
|
67
synthDC/crte_000012580.txt
Normal file
67
synthDC/crte_000012580.txt
Normal file
@ -0,0 +1,67 @@
|
||||
CRTE_SNAPSHOT_START
|
||||
|
||||
SECTION_CRTE_VERSION
|
||||
3.0
|
||||
|
||||
SECTION_PID
|
||||
12580
|
||||
|
||||
SECTION_POLLING_INTERVAL
|
||||
5
|
||||
|
||||
SECTION_DATE_TIME
|
||||
Mon May 16 23:44:09 UTC 2022 (1652744649)
|
||||
|
||||
SECTION_OS_VERSION
|
||||
osname: Linux
|
||||
hostname: tera
|
||||
arch: x86_64
|
||||
release_version: 5.4.157-1-pve
|
||||
|
||||
SECTION_IPC_INFO
|
||||
|
||||
------ Message Queues --------
|
||||
key msqid owner perms used-bytes messages
|
||||
|
||||
------ Shared Memory Segments --------
|
||||
key shmid owner perms bytes nattch status
|
||||
0x00000000 15859713 nwhyte-agu 600 524288 2 dest
|
||||
0x00000000 360451 nwhyte-agu 600 524288 2 dest
|
||||
0x00000000 65540 kkim 600 134217728 2 dest
|
||||
0x00000000 557061 nwhyte-agu 600 67108864 2 dest
|
||||
0x00000000 6 harris 600 524288 2 dest
|
||||
0x00000000 7 harris 600 524288 2 dest
|
||||
0x00000000 5275656 harris 600 2097152 2 dest
|
||||
0x00000000 11993097 kkim 600 524288 2 dest
|
||||
0x00000000 15892490 kkim 600 524288 2 dest
|
||||
0x00000000 11 harris 600 524288 2 SECTION_ULIMIT
|
||||
core file size (blocks, -c) 0
|
||||
data seg size (kbytes, -d) unlimited
|
||||
scheduling priority (-e) 0
|
||||
file size (blocks, -f) unlimited
|
||||
pending signals (-i) 515072
|
||||
max locked memory (kbytes, -l) 64
|
||||
max memory size (kbytes, -m) unlimited
|
||||
open files (-n) 524288
|
||||
pipe size (512 bytes, -p) 8
|
||||
POSIX message queues (bytes, -q) 819200
|
||||
real-time priority (-r) 0
|
||||
stack size (kbytes, -s) unlimited
|
||||
cpu time (seconds, -t) unlimited
|
||||
max user processes (-u) 515072
|
||||
virtual memory (kbytes, -v) unlimited
|
||||
file locks (-x) unlimited
|
||||
|
||||
SECTION_SYSCONF
|
||||
_SC_THREAD_SAFE_FUNCTIONS= 200809
|
||||
_SC_CLK_TCK= 100
|
||||
_SC_OPEN_MAX= 524288
|
||||
_SC_PAGE_SIZE= 4096
|
||||
_SC_ARG_MAX= 4611686018427387903
|
||||
_SC_CHILD_MAX= 515072
|
||||
_SC_LINE_MAX= 2048
|
||||
|
||||
SECTION_FULL_COMMAND
|
||||
/cad/synopsys/SYN/linux64/syn/bin/common_shell_exec -64 -shell dc_shell -r /cad/synopsys/SYN -f scripts/synth.tcl
|
||||
|
||||
SECTION_CPUINFO
|
67
synthDC/crte_000032764.txt
Normal file
67
synthDC/crte_000032764.txt
Normal file
@ -0,0 +1,67 @@
|
||||
CRTE_SNAPSHOT_START
|
||||
|
||||
SECTION_CRTE_VERSION
|
||||
3.0
|
||||
|
||||
SECTION_PID
|
||||
32764
|
||||
|
||||
SECTION_POLLING_INTERVAL
|
||||
5
|
||||
|
||||
SECTION_DATE_TIME
|
||||
Tue May 17 00:05:18 UTC 2022 (1652745918)
|
||||
|
||||
SECTION_OS_VERSION
|
||||
osname: Linux
|
||||
hostname: tera
|
||||
arch: x86_64
|
||||
release_version: 5.4.157-1-pve
|
||||
|
||||
SECTION_IPC_INFO
|
||||
|
||||
------ Message Queues --------
|
||||
key msqid owner perms used-bytes messages
|
||||
|
||||
------ Shared Memory Segments --------
|
||||
key shmid owner perms bytes nattch status
|
||||
0x00000000 360451 nwhyte-agu 600 524288 2 dest
|
||||
0x00000000 65540 kkim 600 134217728 2 dest
|
||||
0x00000000 557061 nwhyte-agu 600 67108864 2 dest
|
||||
0x00000000 6 harris 600 524288 2 dest
|
||||
0x00000000 7 harris 600 524288 2 dest
|
||||
0x00000000 5275656 harris 600 2097152 2 dest
|
||||
0x00000000 11993097 kkim 600 524288 2 dest
|
||||
0x00000000 15892490 kkim 600 524288 2 dest
|
||||
0x00000000 11 harris 600 524288 2 dest
|
||||
0x00000000 15204364 harris 644 790528 3 SECTION_ULIMIT
|
||||
core file size (blocks, -c) 0
|
||||
data seg size (kbytes, -d) unlimited
|
||||
scheduling priority (-e) 0
|
||||
file size (blocks, -f) unlimited
|
||||
pending signals (-i) 515072
|
||||
max locked memory (kbytes, -l) 64
|
||||
max memory size (kbytes, -m) unlimited
|
||||
open files (-n) 524288
|
||||
pipe size (512 bytes, -p) 8
|
||||
POSIX message queues (bytes, -q) 819200
|
||||
real-time priority (-r) 0
|
||||
stack size (kbytes, -s) unlimited
|
||||
cpu time (seconds, -t) unlimited
|
||||
max user processes (-u) 515072
|
||||
virtual memory (kbytes, -v) unlimited
|
||||
file locks (-x) unlimited
|
||||
|
||||
SECTION_SYSCONF
|
||||
_SC_THREAD_SAFE_FUNCTIONS= 200809
|
||||
_SC_CLK_TCK= 100
|
||||
_SC_OPEN_MAX= 524288
|
||||
_SC_PAGE_SIZE= 4096
|
||||
_SC_ARG_MAX= 4611686018427387903
|
||||
_SC_CHILD_MAX= 515072
|
||||
_SC_LINE_MAX= 2048
|
||||
|
||||
SECTION_FULL_COMMAND
|
||||
/cad/synopsys/SYN/linux64/syn/bin/common_shell_exec -64 -shell dc_shell -r /cad/synopsys/SYN -f scripts/synth.tcl
|
||||
|
||||
SECTION_CPUINFO
|
67
synthDC/crte_000057184.txt
Normal file
67
synthDC/crte_000057184.txt
Normal file
@ -0,0 +1,67 @@
|
||||
CRTE_SNAPSHOT_START
|
||||
|
||||
SECTION_CRTE_VERSION
|
||||
3.0
|
||||
|
||||
SECTION_PID
|
||||
57184
|
||||
|
||||
SECTION_POLLING_INTERVAL
|
||||
5
|
||||
|
||||
SECTION_DATE_TIME
|
||||
Mon May 16 22:54:26 UTC 2022 (1652741666)
|
||||
|
||||
SECTION_OS_VERSION
|
||||
osname: Linux
|
||||
hostname: tera
|
||||
arch: x86_64
|
||||
release_version: 5.4.157-1-pve
|
||||
|
||||
SECTION_IPC_INFO
|
||||
|
||||
------ Message Queues --------
|
||||
key msqid owner perms used-bytes messages
|
||||
|
||||
------ Shared Memory Segments --------
|
||||
key shmid owner perms bytes nattch status
|
||||
0x00000000 15859713 nwhyte-agu 600 524288 2 dest
|
||||
0x00000000 360451 nwhyte-agu 600 524288 2 dest
|
||||
0x00000000 65540 kkim 600 134217728 2 dest
|
||||
0x00000000 557061 nwhyte-agu 600 67108864 2 dest
|
||||
0x00000000 6 harris 600 524288 2 dest
|
||||
0x00000000 7 harris 600 524288 2 dest
|
||||
0x00000000 5275656 harris 600 2097152 2 dest
|
||||
0x00000000 11993097 kkim 600 524288 2 dest
|
||||
0x00000000 15892490 kkim 600 524288 2 dest
|
||||
0x00000000 11 harris 600 524288 2 SECTION_ULIMIT
|
||||
core file size (blocks, -c) 0
|
||||
data seg size (kbytes, -d) unlimited
|
||||
scheduling priority (-e) 0
|
||||
file size (blocks, -f) unlimited
|
||||
pending signals (-i) 515072
|
||||
max locked memory (kbytes, -l) 64
|
||||
max memory size (kbytes, -m) unlimited
|
||||
open files (-n) 524288
|
||||
pipe size (512 bytes, -p) 8
|
||||
POSIX message queues (bytes, -q) 819200
|
||||
real-time priority (-r) 0
|
||||
stack size (kbytes, -s) unlimited
|
||||
cpu time (seconds, -t) unlimited
|
||||
max user processes (-u) 515072
|
||||
virtual memory (kbytes, -v) unlimited
|
||||
file locks (-x) unlimited
|
||||
|
||||
SECTION_SYSCONF
|
||||
_SC_THREAD_SAFE_FUNCTIONS= 200809
|
||||
_SC_CLK_TCK= 100
|
||||
_SC_OPEN_MAX= 524288
|
||||
_SC_PAGE_SIZE= 4096
|
||||
_SC_ARG_MAX= 4611686018427387903
|
||||
_SC_CHILD_MAX= 515072
|
||||
_SC_LINE_MAX= 2048
|
||||
|
||||
SECTION_FULL_COMMAND
|
||||
/cad/synopsys/SYN/linux64/syn/bin/common_shell_exec -64 -shell dc_shell -r /cad/synopsys/SYN -f scripts/synth.tcl
|
||||
|
||||
SECTION_CPUINFO
|
67
synthDC/crte_000057185.txt
Normal file
67
synthDC/crte_000057185.txt
Normal file
@ -0,0 +1,67 @@
|
||||
CRTE_SNAPSHOT_START
|
||||
|
||||
SECTION_CRTE_VERSION
|
||||
3.0
|
||||
|
||||
SECTION_PID
|
||||
57185
|
||||
|
||||
SECTION_POLLING_INTERVAL
|
||||
5
|
||||
|
||||
SECTION_DATE_TIME
|
||||
Mon May 16 22:54:26 UTC 2022 (1652741666)
|
||||
|
||||
SECTION_OS_VERSION
|
||||
osname: Linux
|
||||
hostname: tera
|
||||
arch: x86_64
|
||||
release_version: 5.4.157-1-pve
|
||||
|
||||
SECTION_IPC_INFO
|
||||
|
||||
------ Message Queues --------
|
||||
key msqid owner perms used-bytes messages
|
||||
|
||||
------ Shared Memory Segments --------
|
||||
key shmid owner perms bytes nattch status
|
||||
0x00000000 15859713 nwhyte-agu 600 524288 2 dest
|
||||
0x00000000 360451 nwhyte-agu 600 524288 2 dest
|
||||
0x00000000 65540 kkim 600 134217728 2 dest
|
||||
0x00000000 557061 nwhyte-agu 600 67108864 2 dest
|
||||
0x00000000 6 harris 600 524288 2 dest
|
||||
0x00000000 7 harris 600 524288 2 dest
|
||||
0x00000000 5275656 harris 600 2097152 2 dest
|
||||
0x00000000 11993097 kkim 600 524288 2 dest
|
||||
0x00000000 15892490 kkim 600 524288 2 dest
|
||||
0x00000000 11 harris 600 524288 2 SECTION_ULIMIT
|
||||
core file size (blocks, -c) 0
|
||||
data seg size (kbytes, -d) unlimited
|
||||
scheduling priority (-e) 0
|
||||
file size (blocks, -f) unlimited
|
||||
pending signals (-i) 515072
|
||||
max locked memory (kbytes, -l) 64
|
||||
max memory size (kbytes, -m) unlimited
|
||||
open files (-n) 524288
|
||||
pipe size (512 bytes, -p) 8
|
||||
POSIX message queues (bytes, -q) 819200
|
||||
real-time priority (-r) 0
|
||||
stack size (kbytes, -s) unlimited
|
||||
cpu time (seconds, -t) unlimited
|
||||
max user processes (-u) 515072
|
||||
virtual memory (kbytes, -v) unlimited
|
||||
file locks (-x) unlimited
|
||||
|
||||
SECTION_SYSCONF
|
||||
_SC_THREAD_SAFE_FUNCTIONS= 200809
|
||||
_SC_CLK_TCK= 100
|
||||
_SC_OPEN_MAX= 524288
|
||||
_SC_PAGE_SIZE= 4096
|
||||
_SC_ARG_MAX= 4611686018427387903
|
||||
_SC_CHILD_MAX= 515072
|
||||
_SC_LINE_MAX= 2048
|
||||
|
||||
SECTION_FULL_COMMAND
|
||||
/cad/synopsys/SYN/linux64/syn/bin/common_shell_exec -64 -shell dc_shell -r /cad/synopsys/SYN -f scripts/synth.tcl
|
||||
|
||||
SECTION_CPUINFO
|
110
synthDC/ppa.py
110
synthDC/ppa.py
@ -1,110 +0,0 @@
|
||||
#!/usr/bin/python3
|
||||
#from msilib.schema import File
|
||||
import subprocess
|
||||
from multiprocessing import Pool
|
||||
import csv
|
||||
import re
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
|
||||
|
||||
def run_command(module, width, tech, freq):
|
||||
command = "make synth DESIGN=ppa_{}_{} TECH={} DRIVE=INV FREQ={} MAXOPT=1".format(module, width, tech, freq)
|
||||
subprocess.Popen(command, shell=True)
|
||||
|
||||
def deleteRedundant(LoT):
|
||||
'''not working'''
|
||||
synthStr = "rm -rf runs/ppa_{}_{}_rv32e_{}_{}_*"
|
||||
for synth in LoT:
|
||||
print(synth)
|
||||
bashCommand = synthStr.format(*synth)
|
||||
outputCPL = subprocess.check_output(['bash','-c', bashCommand])
|
||||
|
||||
widths = ['8']
|
||||
modules = ['add']
|
||||
freqs = ['10']
|
||||
tech = 'sky90'
|
||||
|
||||
LoT = []
|
||||
for module in modules:
|
||||
for width in widths:
|
||||
for freq in freqs:
|
||||
LoT += [[module, width, tech, freq]]
|
||||
|
||||
deleteRedundant(LoT)
|
||||
|
||||
pool = Pool()
|
||||
pool.starmap(run_command, LoT)
|
||||
pool.close()
|
||||
|
||||
bashCommand = "grep 'Critical Path Length' runs/ppa_*/reports/*qor*"
|
||||
outputCPL = subprocess.check_output(['bash','-c', bashCommand])
|
||||
linesCPL = outputCPL.decode("utf-8").split('\n')[:-1]
|
||||
|
||||
bashCommand = "grep 'Design Area' runs/ppa_*/reports/*qor*"
|
||||
outputDA = subprocess.check_output(['bash','-c', bashCommand])
|
||||
linesDA = outputDA.decode("utf-8").split('\n')[:-1]
|
||||
|
||||
cpl = re.compile('\d{1}\.\d{6}')
|
||||
f = re.compile('_\d*_MHz')
|
||||
wm = re.compile('ppa_\w*_\d*_qor')
|
||||
da = re.compile('\d*\.\d{6}')
|
||||
|
||||
allSynths = []
|
||||
|
||||
for i in range(len(linesCPL)):
|
||||
line = linesCPL[i]
|
||||
mwm = wm.findall(line)[0][4:-4].split('_')
|
||||
oneSynth = [mwm[0], int(mwm[1])]
|
||||
oneSynth += [int(f.findall(line)[0][1:-4])]
|
||||
oneSynth += [float(cpl.findall(line)[0])]
|
||||
oneSynth += [float(da.findall(linesDA[i])[0])]
|
||||
allSynths += [oneSynth]
|
||||
|
||||
file = open("ppaData.csv", "w")
|
||||
writer = csv.writer(file)
|
||||
writer.writerow(['Module', 'Width', 'Target Freq', 'Delay', 'Area'])
|
||||
|
||||
for one in allSynths:
|
||||
writer.writerow(one)
|
||||
|
||||
file.close()
|
||||
|
||||
|
||||
def plotPPA(module, freq, var):
|
||||
'''
|
||||
module: string module name
|
||||
freq: int freq (GHz)
|
||||
var: string 'delay' or 'area'
|
||||
plots chosen variable vs width for all matching syntheses with regression
|
||||
'''
|
||||
global allSynths
|
||||
ind = 3 if (var == 'delay') else 4
|
||||
widths = []
|
||||
ivar = []
|
||||
for oneSynth in allSynths:
|
||||
if (oneSynth[0] == module) & (oneSynth[2] == freq):
|
||||
|
||||
widths += [oneSynth[1]]
|
||||
ivar += [oneSynth[ind]]
|
||||
|
||||
x = np.array(widths, dtype=np.int)
|
||||
y = np.array(ivar, dtype=np.float)
|
||||
|
||||
A = np.vstack([x, np.ones(len(x))]).T
|
||||
m, c = np.linalg.lstsq(A, y, rcond=None)[0]
|
||||
z = np.polyfit(x, y, 2)
|
||||
p = np.poly1d(z)
|
||||
|
||||
xp = np.linspace(0, 140, 200)
|
||||
|
||||
_ = plt.plot(x, y, 'o', label=module, markersize=10)
|
||||
_ = plt.plot(x, m*x + c, 'r', label='Linear fit')
|
||||
_ = plt.plot(xp, p(xp), label='Quadratic fit')
|
||||
_ = plt.legend()
|
||||
_ = plt.xlabel("Width (bits)")
|
||||
_ = plt.ylabel(str.title(var))
|
||||
plt.show()
|
||||
|
||||
|
||||
plotPPA('add', 5000, 'delay')
|
95
synthDC/ppaAnalyze.py
Executable file
95
synthDC/ppaAnalyze.py
Executable file
@ -0,0 +1,95 @@
|
||||
#!/usr/bin/python3
|
||||
import subprocess
|
||||
import csv
|
||||
import re
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
|
||||
def getData():
|
||||
bashCommand = "grep 'Critical Path Length' runs/ppa_*/reports/*qor*"
|
||||
outputCPL = subprocess.check_output(['bash','-c', bashCommand])
|
||||
linesCPL = outputCPL.decode("utf-8").split('\n')[:-1]
|
||||
|
||||
bashCommand = "grep 'Design Area' runs/ppa_*/reports/*qor*"
|
||||
outputDA = subprocess.check_output(['bash','-c', bashCommand])
|
||||
linesDA = outputDA.decode("utf-8").split('\n')[:-1]
|
||||
|
||||
cpl = re.compile('\d{1}\.\d{6}')
|
||||
f = re.compile('_\d*_MHz')
|
||||
wm = re.compile('ppa_\w*_\d*_qor')
|
||||
da = re.compile('\d*\.\d{6}')
|
||||
|
||||
allSynths = []
|
||||
|
||||
for i in range(len(linesCPL)):
|
||||
line = linesCPL[i]
|
||||
mwm = wm.findall(line)[0][4:-4].split('_')
|
||||
oneSynth = [mwm[0], int(mwm[1])]
|
||||
oneSynth += [int(f.findall(line)[0][1:-4])]
|
||||
oneSynth += [float(cpl.findall(line)[0])]
|
||||
oneSynth += [float(da.findall(linesDA[i])[0])]
|
||||
allSynths += [oneSynth]
|
||||
|
||||
return allSynths
|
||||
|
||||
def writeCSV(allSynths):
|
||||
file = open("ppaData.csv", "w")
|
||||
writer = csv.writer(file)
|
||||
writer.writerow(['Module', 'Width', 'Target Freq', 'Delay', 'Area'])
|
||||
|
||||
for one in allSynths:
|
||||
writer.writerow(one)
|
||||
|
||||
file.close()
|
||||
|
||||
def plotPPA(module, freq, var):
|
||||
'''
|
||||
module: string module name
|
||||
freq: int freq (GHz)
|
||||
var: string 'delay' or 'area'
|
||||
plots chosen variable vs width for all matching syntheses with regression
|
||||
'''
|
||||
global allSynths
|
||||
ind = 3 if (var == 'delay') else 4
|
||||
widths = []
|
||||
ivar = []
|
||||
for oneSynth in allSynths:
|
||||
if (oneSynth[0] == module) & (oneSynth[2] == freq):
|
||||
|
||||
widths += [oneSynth[1]]
|
||||
ivar += [oneSynth[ind]]
|
||||
|
||||
x = np.array(widths, dtype=np.int)
|
||||
y = np.array(ivar, dtype=np.float)
|
||||
|
||||
A = np.vstack([x, np.ones(len(x))]).T
|
||||
m, c = np.linalg.lstsq(A, y, rcond=None)[0]
|
||||
|
||||
z = np.polyfit(x, y, 2)
|
||||
p = np.poly1d(z)
|
||||
|
||||
zlog = np.polyfit(np.log(x), y, 1)
|
||||
plog = np.poly1d(zlog)
|
||||
|
||||
xp = np.linspace(0, 140, 200)
|
||||
xplog = np.log(xp)
|
||||
|
||||
_ = plt.plot(x, y, 'o', label=module, markersize=10)
|
||||
_ = plt.plot(x, m*x + c, 'r', label='Linear fit')
|
||||
_ = plt.plot(xp, p(xp), label='Quadratic fit')
|
||||
_ = plt.plot(xp, plog(xplog), label = 'Log fit')
|
||||
_ = plt.legend()
|
||||
_ = plt.xlabel("Width (bits)")
|
||||
_ = plt.ylabel(str.title(var))
|
||||
_ = plt.title("Target frequency " + str(freq))
|
||||
plt.show()
|
||||
#fix square microns, picosec, end plots at 8 to stop negs, add equation to plots and R2
|
||||
# try linear term with delay as well (w and wo)
|
||||
|
||||
allSynths = getData()
|
||||
|
||||
writeCSV(allSynths)
|
||||
|
||||
plotPPA('mult', 5000, 'delay')
|
||||
plotPPA('mult', 5000, 'area')
|
||||
plotPPA('mult', 10, 'area')
|
@ -1,28 +1,38 @@
|
||||
Module,Width,Target Freq,Delay,Area
|
||||
add,128,10,7.100851,1867.879976
|
||||
add,128,5000,0.389771,7007.980119
|
||||
add,16,10,2.032906,221.479998
|
||||
add,16,4000,0.249839,551.740010
|
||||
add,16,4000,0.249839,551.74001
|
||||
add,16,5000,0.228259,924.140017
|
||||
add,16,6000,0.225754,1120.140018
|
||||
add,32,10,4.160501,456.679995
|
||||
add,32,4000,0.280842,1730.680031
|
||||
add,32,5000,0.250500,1933.540033
|
||||
add,32,6000,0.271774,1746.360030
|
||||
add,32,5000,0.2505,1933.540033
|
||||
add,32,6000,0.271774,1746.36003
|
||||
add,64,10,8.474034,927.079988
|
||||
add,64,4000,0.323267,3758.300065
|
||||
add,64,5000,0.334061,3798.480071
|
||||
add,64,6000,0.328457,3749.480066
|
||||
add,8,10,0.940062,103.879999
|
||||
add,8,5000,0.199689,197.960003
|
||||
comparator,128,10,0.842074,1997.240039
|
||||
comparator,128,5000,0.260142,5215.56005
|
||||
comparator,16,10,0.576329,252.840005
|
||||
comparator,16,4000,0.249312,280.280005
|
||||
comparator,16,5000,0.199026,313.600006
|
||||
comparator,16,6000,0.166568,422.380007
|
||||
comparator,32,10,0.765874,495.880010
|
||||
comparator,32,4000,0.249950,608.580012
|
||||
comparator,32,10,0.765874,495.88001
|
||||
comparator,32,4000,0.24995,608.580012
|
||||
comparator,32,5000,0.205372,919.240014
|
||||
comparator,32,6000,0.201200,1248.520016
|
||||
comparator,64,10,0.561562,1008.420020
|
||||
comparator,32,6000,0.2012,1248.520016
|
||||
comparator,64,10,0.561562,1008.42002
|
||||
comparator,64,4000,0.249905,1437.660027
|
||||
comparator,64,5000,0.219296,2738.120023
|
||||
comparator,64,6000,0.221138,2341.220025
|
||||
comparator,8,10,0.29577,118.580002
|
||||
comparator,8,5000,0.195502,129.360003
|
||||
mult,128,10,9.334627,180734.540854
|
||||
mult,128,5000,1.78322,314617.244472
|
||||
mult,16,10,4.730546,3869.040009
|
||||
mult,16,4000,0.821111,9132.620147
|
||||
mult,16,5000,0.820059,9583.420143
|
||||
@ -31,11 +41,16 @@ mult,32,10,7.575772,12412.680067
|
||||
mult,32,4000,1.091389,31262.980534
|
||||
mult,32,5000,1.092153,31497.200524
|
||||
mult,32,6000,1.084816,33519.920555
|
||||
mult,64,10,4.793300,46798.920227
|
||||
mult,64,10,4.7933,46798.920227
|
||||
mult,64,4000,1.411752,93087.261425
|
||||
mult,64,5000,1.404875,94040.801492
|
||||
mult,64,6000,1.415466,89931.661403
|
||||
shifter,16,10,0.000000,0.000000
|
||||
mult,8,10,2.076433,1009.399998
|
||||
mult,8,5000,0.552339,4261.040075
|
||||
shifter,128,10,2.577935,8113.420158
|
||||
shifter,128,5000,0.395847,16602.180268
|
||||
shifter,16,10,0.0,0.0
|
||||
shifter,16,10,0.0,0.0
|
||||
shifter,32,10,1.906335,1656.200032
|
||||
shifter,32,10,1.906335,1656.200032
|
||||
shifter,32,10,1.906335,1656.200032
|
||||
@ -48,3 +63,5 @@ shifter,32,5000,0.238962,4985.260077
|
||||
shifter,32,6000,0.241742,4312.000069
|
||||
shifter,32,6000,0.241742,4312.000069
|
||||
shifter,32,6000,0.241742,4312.000069
|
||||
shifter,8,10,0.0,0.0
|
||||
shifter,8,5000,0.0,0.0
|
||||
|
|
37
synthDC/ppaSynth.py
Executable file
37
synthDC/ppaSynth.py
Executable file
@ -0,0 +1,37 @@
|
||||
#!/usr/bin/python3
|
||||
import subprocess
|
||||
from multiprocessing import Pool
|
||||
|
||||
|
||||
def runCommand(module, width, tech, freq):
|
||||
command = "make synth DESIGN=ppa_{}_{} TECH={} DRIVE=INV FREQ={} MAXOPT=1".format(module, width, tech, freq)
|
||||
subprocess.Popen(command, shell=True)
|
||||
|
||||
def deleteRedundant(LoT):
|
||||
'''removes any previous runs for the current synthesis specifications'''
|
||||
synthStr = "rm -rf runs/ppa_{}_{}_rv32e_{}nm_{}_*"
|
||||
for synth in LoT:
|
||||
bashCommand = synthStr.format(*synth)
|
||||
outputCPL = subprocess.check_output(['bash','-c', bashCommand])
|
||||
|
||||
widths = ['128']
|
||||
modules = ['mult']
|
||||
freqs = ['5000']
|
||||
tech = 'sky90'
|
||||
|
||||
#to run: add 8 10, shifter 8 16 (check .sv!)
|
||||
|
||||
LoT = []
|
||||
for module in modules:
|
||||
for width in widths:
|
||||
for freq in freqs:
|
||||
LoT += [[module, width, tech, freq]]
|
||||
|
||||
deleteRedundant(LoT)
|
||||
|
||||
pool = Pool()
|
||||
pool.starmap(runCommand, LoT)
|
||||
pool.close()
|
||||
|
||||
bashCommand = "wait"
|
||||
outputCPL = subprocess.check_output(['bash','-c', bashCommand])
|
Loading…
Reference in New Issue
Block a user