mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
Merge pull request #400 from kipmacsaigoren/synth_wrapper_gen
configurability for synthesis wrapper generation
This commit is contained in:
commit
1946b3cc58
@ -3,7 +3,6 @@
|
|||||||
# Shreya Sanghai (ssanghai@hmc.edu) 2/28/2022
|
# Shreya Sanghai (ssanghai@hmc.edu) 2/28/2022
|
||||||
# Madeleine Masser-Frye (mmasserfrye@hmc.edu) 1/27/2023
|
# Madeleine Masser-Frye (mmasserfrye@hmc.edu) 1/27/2023
|
||||||
NAME := synth
|
NAME := synth
|
||||||
|
|
||||||
# defaults
|
# defaults
|
||||||
export DESIGN ?= wallypipelinedcore
|
export DESIGN ?= wallypipelinedcore
|
||||||
export FREQ ?= 10000
|
export FREQ ?= 10000
|
||||||
@ -18,9 +17,12 @@ export TECH ?= sky90
|
|||||||
export MAXCORES ?= 1
|
export MAXCORES ?= 1
|
||||||
# MAXOPT turns on flattening, boundary optimization, and retiming
|
# MAXOPT turns on flattening, boundary optimization, and retiming
|
||||||
# The output netlist is hard to interpret, but significantly better PPA
|
# The output netlist is hard to interpret, but significantly better PPA
|
||||||
|
# WRAPPER turns on wrapper generation
|
||||||
export MAXOPT ?= 0
|
export MAXOPT ?= 0
|
||||||
export DRIVE ?= FLOP
|
export DRIVE ?= FLOP
|
||||||
export USESRAM ?= 0
|
export USESRAM ?= 0
|
||||||
|
export WRAPPER ?= 0
|
||||||
|
|
||||||
|
|
||||||
time := $(shell date +%F-%H-%M)
|
time := $(shell date +%F-%H-%M)
|
||||||
hash := $(shell git rev-parse --short HEAD)
|
hash := $(shell git rev-parse --short HEAD)
|
||||||
@ -120,7 +122,9 @@ endif
|
|||||||
|
|
||||||
|
|
||||||
mkwrapper:
|
mkwrapper:
|
||||||
|
ifeq ($(WRAPPER),1)
|
||||||
python3 $(WALLY)/synthDC/scripts/wrapperGen.py $(DESIGN)
|
python3 $(WALLY)/synthDC/scripts/wrapperGen.py $(DESIGN)
|
||||||
|
endif
|
||||||
mkdirecs:
|
mkdirecs:
|
||||||
@echo "DC Synthesis"
|
@echo "DC Synthesis"
|
||||||
@mkdir -p $(OUTPUTDIR)
|
@mkdir -p $(OUTPUTDIR)
|
||||||
|
@ -16,6 +16,7 @@ suppress_message {VER-173}
|
|||||||
# Enable Multicore
|
# Enable Multicore
|
||||||
set_host_options -max_cores $::env(MAXCORES)
|
set_host_options -max_cores $::env(MAXCORES)
|
||||||
|
|
||||||
|
|
||||||
# get outputDir and configDir from environment (Makefile)
|
# get outputDir and configDir from environment (Makefile)
|
||||||
set outputDir $::env(OUTPUTDIR)
|
set outputDir $::env(OUTPUTDIR)
|
||||||
set cfg $::env(CONFIGDIR)
|
set cfg $::env(CONFIGDIR)
|
||||||
@ -23,13 +24,17 @@ set hdl_src "../src"
|
|||||||
set saifpower $::env(SAIFPOWER)
|
set saifpower $::env(SAIFPOWER)
|
||||||
set maxopt $::env(MAXOPT)
|
set maxopt $::env(MAXOPT)
|
||||||
set drive $::env(DRIVE)
|
set drive $::env(DRIVE)
|
||||||
|
set wrapper $::env(WRAPPER)
|
||||||
|
|
||||||
eval file copy -force [glob ${cfg}/*.vh] {$outputDir/hdl/}
|
eval file copy -force [glob ${cfg}/*.vh] {$outputDir/hdl/}
|
||||||
eval file copy -force [glob ${hdl_src}/cvw.sv] {$outputDir/hdl/}
|
eval file copy -force [glob ${hdl_src}/cvw.sv] {$outputDir/hdl/}
|
||||||
#eval file copy -force [glob ${hdl_src}/../fpga/src/wallypipelinedsocwrapper.sv] {$outputDir/hdl/}
|
#eval file copy -force [glob ${hdl_src}/../fpga/src/wallypipelinedsocwrapper.sv] {$outputDir/hdl/}
|
||||||
eval file copy -force [glob ${hdl_src}/*/*.sv] {$outputDir/hdl/}
|
eval file copy -force [glob ${hdl_src}/*/*.sv] {$outputDir/hdl/}
|
||||||
eval file copy -force [glob ${hdl_src}/*/*/*.sv] {$outputDir/hdl/}
|
eval file copy -force [glob ${hdl_src}/*/*/*.sv] {$outputDir/hdl/}
|
||||||
eval file copy -force [glob ${hdl_src}/../synthDC/wrappers/$::env(DESIGN)wrapper.sv] {$outputDir/hdl/}
|
if {$wrapper ==1 } {
|
||||||
|
eval file copy -force [glob ${hdl_src}/../synthDC/wrappers/$::env(DESIGN)wrapper.sv] {$outputDir/hdl/}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# Only for FMA class project; comment out when done
|
# Only for FMA class project; comment out when done
|
||||||
# eval file copy -force [glob ${hdl_src}/fma/fma16.v] {hdl/}
|
# eval file copy -force [glob ${hdl_src}/fma/fma16.v] {hdl/}
|
||||||
@ -43,7 +48,11 @@ if { $saifpower == 1 } {
|
|||||||
set my_verilog_files [glob $outputDir/hdl/cvw.sv $outputDir/hdl/*.sv]
|
set my_verilog_files [glob $outputDir/hdl/cvw.sv $outputDir/hdl/*.sv]
|
||||||
|
|
||||||
# Set toplevel
|
# Set toplevel
|
||||||
set my_toplevel $::env(DESIGN)wrapper
|
if { $wrapper == 1 } {
|
||||||
|
set my_toplevel $::env(DESIGN)wrapper
|
||||||
|
} else {
|
||||||
|
set my_toplevel $::env(DESIGN)
|
||||||
|
}
|
||||||
|
|
||||||
# Set number of significant digits
|
# Set number of significant digits
|
||||||
set report_default_significant_digits 6
|
set report_default_significant_digits 6
|
||||||
|
@ -63,7 +63,7 @@ buf += f"\t{moduleName} #(P) dut(.*);\nendmodule"
|
|||||||
wrapperPath = f"{os.getenv('WALLY')}/synthDC/wrappers/{moduleName}wrapper.sv"
|
wrapperPath = f"{os.getenv('WALLY')}/synthDC/wrappers/{moduleName}wrapper.sv"
|
||||||
|
|
||||||
# clear wrappers directory
|
# clear wrappers directory
|
||||||
os.system(f"rm {os.getenv('WALLY')}/src/wrappers/*")
|
os.system(f"rm {os.getenv('WALLY')}/synthDC/wrappers/*")
|
||||||
|
|
||||||
fout = open(wrapperPath, "w")
|
fout = open(wrapperPath, "w")
|
||||||
|
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
import cvw::*;
|
|
||||||
`include "config.vh"
|
|
||||||
`include "parameter-defs.vh"
|
|
||||||
module wallypipelinedcorewrapper (
|
|
||||||
input logic clk, reset,
|
|
||||||
// Privileged
|
|
||||||
input logic MTimerInt, MExtInt, SExtInt, MSwInt,
|
|
||||||
input logic [63:0] MTIME_CLINT,
|
|
||||||
// Bus Interface
|
|
||||||
input logic [P.AHBW-1:0] HRDATA,
|
|
||||||
input logic HREADY, HRESP,
|
|
||||||
output logic HCLK, HRESETn,
|
|
||||||
output logic [P.PA_BITS-1:0] HADDR,
|
|
||||||
output logic [P.AHBW-1:0] HWDATA,
|
|
||||||
output logic [P.XLEN/8-1:0] HWSTRB,
|
|
||||||
output logic HWRITE,
|
|
||||||
output logic [2:0] HSIZE,
|
|
||||||
output logic [2:0] HBURST,
|
|
||||||
output logic [3:0] HPROT,
|
|
||||||
output logic [1:0] HTRANS,
|
|
||||||
output logic HMASTLOCK
|
|
||||||
);
|
|
||||||
wallypipelinedcore #(P) dut(.*);
|
|
||||||
endmodule
|
|
Loading…
Reference in New Issue
Block a user