From 2ca897620fd4a0bea56b6753ef53b53c17eed021 Mon Sep 17 00:00:00 2001 From: mmasserfrye Date: Mon, 16 May 2022 15:39:15 +0000 Subject: [PATCH] tuning modules for ppa --- pipelined/src/ppa/ppa.sv | 29 ++++++++++- synthDC/Synopsys_stack_trace_52064.txt | 17 +++++++ synthDC/Synopsys_stack_trace_55441.txt | 17 +++++++ synthDC/crte_000052064.txt | 67 ++++++++++++++++++++++++++ synthDC/crte_000055441.txt | 67 ++++++++++++++++++++++++++ synthDC/ppa.py | 11 +++-- synthDC/ppaData.csv | 5 ++ 7 files changed, 208 insertions(+), 5 deletions(-) create mode 100644 synthDC/Synopsys_stack_trace_52064.txt create mode 100644 synthDC/Synopsys_stack_trace_55441.txt create mode 100644 synthDC/crte_000052064.txt create mode 100644 synthDC/crte_000055441.txt diff --git a/pipelined/src/ppa/ppa.sv b/pipelined/src/ppa/ppa.sv index 1ce9b4496..d1ed9d500 100644 --- a/pipelined/src/ppa/ppa.sv +++ b/pipelined/src/ppa/ppa.sv @@ -180,12 +180,39 @@ module ppa_shiftleft #(parameter WIDTH=32) ( assign y = a << amt; endmodule +module ppa_shifter_16 #(parameter WIDTH=16) ( + input logic [WIDTH-1:0] A, + input logic [$clog2(WIDTH)-1:0] Amt, + input logic Right, Arith, W64, + output logic [WIDTH-1:0] Y); + + ppa_shifter #(WIDTH) sh (.*); +endmodule + module ppa_shifter_32 #(parameter WIDTH=32) ( input logic [WIDTH-1:0] A, input logic [$clog2(WIDTH)-1:0] Amt, input logic Right, Arith, W64, output logic [WIDTH-1:0] Y); + ppa_shifter #(WIDTH) sh (.*); +endmodule + +module ppa_shifter_64 #(parameter WIDTH=64) ( + input logic [WIDTH-1:0] A, + input logic [$clog2(WIDTH)-1:0] Amt, + input logic Right, Arith, W64, + output logic [WIDTH-1:0] Y); + + ppa_shifter #(WIDTH) sh (.*); +endmodule + +module ppa_shifter #(parameter WIDTH=32) ( + input logic [WIDTH-1:0] A, + input logic [$clog2(WIDTH)-1:0] Amt, + input logic Right, Arith, W64, + output logic [WIDTH-1:0] Y); + logic [2*WIDTH-2:0] z, zshift; logic [$clog2(WIDTH)-1:0] amttrunc, offset; @@ -264,7 +291,7 @@ module ppa_prioriyencoder #(parameter N = 8) ( end endmodule -module ppa_decoder ( +module ppa_decoder #(parameter N = 8) ( input logic [$clog2(N)-1:0] a, output logic [N-1:0] y); always_comb begin diff --git a/synthDC/Synopsys_stack_trace_52064.txt b/synthDC/Synopsys_stack_trace_52064.txt new file mode 100644 index 000000000..f62c1acfc --- /dev/null +++ b/synthDC/Synopsys_stack_trace_52064.txt @@ -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 +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: +. +Find the GDB manual and other documentation resources online at: + . + +For help, type "help". +Type "apropos word" to search for commands related to "word". +Attaching to process 52064 +(gdb) (gdb) (gdb) (gdb) \ No newline at end of file diff --git a/synthDC/Synopsys_stack_trace_55441.txt b/synthDC/Synopsys_stack_trace_55441.txt new file mode 100644 index 000000000..0e7a3c988 --- /dev/null +++ b/synthDC/Synopsys_stack_trace_55441.txt @@ -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 +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: +. +Find the GDB manual and other documentation resources online at: + . + +For help, type "help". +Type "apropos word" to search for commands related to "word". +Attaching to process 55441 +(gdb) (gdb) (gdb) (gdb) \ No newline at end of file diff --git a/synthDC/crte_000052064.txt b/synthDC/crte_000052064.txt new file mode 100644 index 000000000..2eef81a43 --- /dev/null +++ b/synthDC/crte_000052064.txt @@ -0,0 +1,67 @@ +CRTE_SNAPSHOT_START + +SECTION_CRTE_VERSION +3.0 + +SECTION_PID +52064 + +SECTION_POLLING_INTERVAL +5 + +SECTION_DATE_TIME +Thu May 12 21:44:48 UTC 2022 (1652391888) + +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 11 harris 600 524288 2 dest +0x00000000 15204364 harris 644 790528 2 dest +0x00000000 7372813 chuang 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 diff --git a/synthDC/crte_000055441.txt b/synthDC/crte_000055441.txt new file mode 100644 index 000000000..7bd6f6855 --- /dev/null +++ b/synthDC/crte_000055441.txt @@ -0,0 +1,67 @@ +CRTE_SNAPSHOT_START + +SECTION_CRTE_VERSION +3.0 + +SECTION_PID +55441 + +SECTION_POLLING_INTERVAL +5 + +SECTION_DATE_TIME +Thu May 12 21:47:47 UTC 2022 (1652392067) + +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 11 harris 600 524288 2 dest +0x00000000 15204364 harris 644 790528 2 dest +0x00000000 7372813 chuang 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 diff --git a/synthDC/ppa.py b/synthDC/ppa.py index 91b21d880..4d1657771 100755 --- a/synthDC/ppa.py +++ b/synthDC/ppa.py @@ -4,17 +4,19 @@ import subprocess from multiprocessing import Pool import csv import re -import matplotlib.pyplot as plt -import numpy as np +# import matplotlib.pyplot as plt +# import numpy as np +print("hi") def run_command(module, width, freq): command = "make synth DESIGN=ppa_{}_{} TECH=sky90 DRIVE=INV FREQ={} MAXOPT=1".format(module, width, freq) subprocess.Popen(command, shell=True) -widths = ['32'] +widths = ['16'] modules = ['shifter'] -freqs = ['10', '4000', '5000', '6000'] +freqs = ['10'] + LoT = [] for module in modules: @@ -24,6 +26,7 @@ for module in modules: 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]) diff --git a/synthDC/ppaData.csv b/synthDC/ppaData.csv index 0919db4ce..368547c60 100644 --- a/synthDC/ppaData.csv +++ b/synthDC/ppaData.csv @@ -35,11 +35,16 @@ mult,64,10,4.793300,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 +shifter,32,10,1.906335,1656.200032 shifter,32,10,1.906335,1656.200032 shifter,32,10,1.906335,1656.200032 shifter,32,4000,0.260606,3490.760054 shifter,32,4000,0.260606,3490.760054 +shifter,32,4000,0.260606,3490.760054 +shifter,32,5000,0.238962,4985.260077 shifter,32,5000,0.238962,4985.260077 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