Skip to content

Commit

Permalink
Major Restructure: Move RTL,TCL,TB to deepsocflow for deployment. Kee…
Browse files Browse the repository at this point in the history
…p config and build files outside
  • Loading branch information
Aba committed Nov 16, 2023
1 parent 8a5eb2e commit 6290620
Show file tree
Hide file tree
Showing 65 changed files with 100 additions and 145 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ jobs:
export PATH=${VERILATOR_ROOT}/bin:${PATH}
export PYMTL_VERILATOR_INCLUDE_DIR=${VERILATOR_ROOT}/share/verilator/include
verilator --version
cd test
python -m pytest -s py/param_test.py
pip install .
mkdir -p run/work
cd run/work
python -m pytest -s ../param_test.py
36 changes: 21 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
old/
__pycache__

fpga/*
!fpga/scripts
run/fpga/*

asic/*
!asic/scripts
!asic/reports
run/asic/*
!deepsocflow/asic/reports

*.pickle
test/vectors
test/xsim
test/dnn_engine_tb.vcd
test/xsc*
test/obj_dir
test/models
test/temp
deepsocflow/test/vectors
deepsocflow/test/xsim
deepsocflow/test/dnn_engine_tb.vcd
deepsocflow/test/xsc*
deepsocflow/test/obj_dir
deepsocflow/test/models
deepsocflow/test/temp

test/py/*
deepsocflow/test/py/*

.svls.toml

run/work/vectors/*
run/work/build/*


# Distribution / packaging
.Python
Expand Down Expand Up @@ -50,6 +51,11 @@ MANIFEST

# Sphinx documentation
docs/**
!docs/source
docs/source/**
!docs/source/conf.py
!docs/source/index.rst
!docs/source/modules.rst
!docs/source/*.rst

# VSCode
settings.json
.vscode
4 changes: 2 additions & 2 deletions deepsocflow/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from deepsocflow.py.hardware import *
from deepsocflow.py.utils import *
from . import py
from .py import *
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion c/runtime.h → deepsocflow/c/runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ typedef const struct {

typedef enum {POOL_NONE, POOL_MAX, POOL_AVG} Pool_t;

#include "model.h"
#include "config_fw.h"
#define X_BITS (1 << X_BITS_L2)
#define X_WORDS_PER_BYTE (8 / X_BITS)
#define X_BITS_MASK ((1 << X_BITS) -1)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions deepsocflow/py/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import hardware, bundle
from .hardware import *
from .bundle import *
File renamed without changes.
4 changes: 2 additions & 2 deletions deepsocflow/py/hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def __init__(
self.XN_MAX = max_batch_size
self.CI_MAX = max_channels_in
self.CO_MAX = max_channels_out
self.KH_MAX, self.KW_MAX = max_kernel_size if (type(max_kernel_size) == tuple) else (max_kernel_size, max_kernel_size)
self.XH_MAX, self.XW_MAX = max_image_size if (type(max_image_size) == tuple) else (max_image_size, max_image_size)
self.KH_MAX, self.KW_MAX = tuple(max_kernel_size) if (type(max_kernel_size) in [tuple, list]) else (max_kernel_size, max_kernel_size)
self.XH_MAX, self.XW_MAX = tuple(max_image_size ) if (type(max_image_size ) in [tuple, list]) else (max_image_size , max_image_size )

self.RAM_WEIGHTS_DEPTH = int((weights_cache_kbytes*1024)/(self.K_BITS*self.COLS*2))
'''
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
`include "../rtl/include/params.svh"
`include "defines.svh"

module axis_out_shift #(
localparam ROWS = `ROWS ,
Expand Down
2 changes: 1 addition & 1 deletion rtl/axis_pixels.sv → deepsocflow/rtl/axis_pixels.sv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
`timescale 1ns/1ps
`include "../rtl/include/params.svh"
`include "defines.svh"

module axis_pixels #(
parameter ROWS = `ROWS ,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Engineer: Abarajithan G.
Design Name: AXIS Weight Rotator
*/
`timescale 1ns/1ps
`include "../rtl/include/params.svh"
`include "defines.svh"

module axis_weight_rotator #(
parameter
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion rtl/include/params.svh → deepsocflow/rtl/defines.svh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
`include "params_input.svh"
`include "config_hw.svh"

`define BITS_KW2 $clog2((`KW_MAX+1)/2)

Expand Down
2 changes: 1 addition & 1 deletion rtl/dnn_engine.v → deepsocflow/rtl/dnn_engine.v
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
`timescale 1ns/1ps
`define VERILOG
`include "../rtl/include/params.svh"
`include "defines.svh"
`undef VERILOG

module dnn_engine #(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
`include "../rtl/include/params.svh"
`include "defines.svh"

module out_ram_switch #(
localparam ROWS = `ROWS ,
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion rtl/proc_engine.sv → deepsocflow/rtl/proc_engine.sv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
`timescale 1ns/1ps
`include "../rtl/include/params.svh"
`include "defines.svh"

module proc_engine #(
localparam COLS = `COLS ,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
`timescale 1ns/1ps

`include "../../rtl/include/params.svh"
`include "../xsim/sim_params.svh"
`include "../../rtl/defines.svh"
`include "config_tb.svh"

module dnn_engine_tb;

Expand Down
2 changes: 1 addition & 1 deletion test/sv/ram_raw.sv → deepsocflow/test/sv/ram_raw.sv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
`timescale 1ns/1ps
`include "../../rtl/include/params.svh"
`include "../../rtl/defines.svh"

module ram_raw #(
parameter DEPTH = 1,
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"

[project]
name = "deepsocflow"
authors = [{name = "Abarajithan G", email = "[email protected]"}]
authors = [{name = "Abarajithan G", email = "[email protected]"}, {name = "Zhenghua Ma", email = "[email protected]"}]
version = "0.0.1"
description = "Your DNNs to FPGA/ASIC SoCs in minutes!"
requires-python = ">=3.10"
Expand Down
78 changes: 0 additions & 78 deletions rtl/sram/sdp_array.sv

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 6290620

Please sign in to comment.