-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
treewide: Package Python utilities (#177)
Co-authored-by: Viviane Potocnik <[email protected]> Co-authored-by: Luca Colagrande <[email protected]>
- Loading branch information
1 parent
f0749fd
commit 0fc8be0
Showing
44 changed files
with
148 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,5 @@ gmon.out | |
# Installation directories | ||
/.venv/ | ||
/tools/ | ||
/build/ | ||
/snitch.egg-info/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright 2023 ETH Zurich and University of Bologna. | ||
# Solderpad Hardware License, Version 0.51, see LICENSE for details. | ||
# SPDX-License-Identifier: SHL-0.51 | ||
|
||
[build-system] | ||
requires = ["setuptools>=42"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "snitch" | ||
authors = [ | ||
{name = "Luca Colagrande", email = "[email protected]"} | ||
] | ||
dynamic = ["version"] | ||
|
||
[tool.setuptools.package-dir] | ||
"snitch.dnn" = "sw/dnn" | ||
"snitch.blas" = "sw/blas" | ||
"snitch.util" = "util" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,12 +7,9 @@ | |
# Luca Colagrande <[email protected]> | ||
|
||
import numpy as np | ||
import os | ||
import sys | ||
|
||
sys.path.append(os.path.join(os.path.dirname(__file__), "../../../../util/sim/")) | ||
from data_utils import format_scalar_definition, format_array_definition, \ | ||
format_array_declaration, format_ifdef_wrapper, DataGen # noqa: E402 | ||
from snitch.util.sim.data_utils import format_scalar_definition, format_array_definition, \ | ||
format_array_declaration, format_ifdef_wrapper, DataGen | ||
|
||
|
||
# AXI splits bursts crossing 4KB address boundaries. To minimize | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,12 +7,9 @@ | |
# Luca Colagrande <[email protected]> | ||
|
||
import numpy as np | ||
import os | ||
import sys | ||
|
||
sys.path.append(os.path.join(os.path.dirname(__file__), "../../../../util/sim/")) | ||
from data_utils import format_scalar_definition, format_array_definition, \ | ||
format_array_declaration, format_ifdef_wrapper, DataGen # noqa: E402 | ||
from snitch.util.sim.data_utils import format_scalar_definition, format_array_definition, \ | ||
format_array_declaration, format_ifdef_wrapper, DataGen | ||
|
||
|
||
# AXI splits bursts crossing 4KB address boundaries. To minimize | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,12 +7,9 @@ | |
# Luca Colagrande <[email protected]> | ||
|
||
import numpy as np | ||
import os | ||
import sys | ||
|
||
sys.path.append(os.path.join(os.path.dirname(__file__), "../../../../util/sim/")) | ||
from data_utils import format_scalar_definition, format_array_definition, \ | ||
format_array_declaration, format_ifdef_wrapper, DataGen # noqa: E402 | ||
from snitch.util.sim.data_utils import format_scalar_definition, format_array_definition, \ | ||
format_array_declaration, format_ifdef_wrapper, DataGen | ||
|
||
|
||
# AXI splits bursts crossing 4KB address boundaries. To minimize | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Copyright 2024 ETH Zurich and University of Bologna. | ||
# Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Luca Colagrande <[email protected]> | ||
|
||
from . import gemm | ||
|
||
__all__ = ['gemm'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,12 +6,10 @@ | |
# Author: Luca Colagrande <[email protected]> | ||
|
||
import numpy as np | ||
import os | ||
import sys | ||
|
||
sys.path.append(os.path.join(os.path.dirname(__file__), "../../../../util/sim/")) | ||
from data_utils import format_scalar_definition, format_array_definition, \ | ||
format_array_declaration, format_ifdef_wrapper, DataGen # noqa: E402 | ||
from snitch.util.sim.data_utils import format_scalar_definition, format_array_definition, \ | ||
format_array_declaration, format_ifdef_wrapper, DataGen | ||
|
||
|
||
class AxpyDataGen(DataGen): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,9 @@ | |
# Luca Colagrande <[email protected]> | ||
|
||
import sys | ||
from pathlib import Path | ||
from datagen import AxpyDataGen | ||
|
||
sys.path.append(str(Path(__file__).parent / '../../../../util/sim/')) | ||
from verif_utils import Verifier # noqa: E402 | ||
from snitch.util.sim.verif_utils import Verifier | ||
|
||
|
||
class AxpyVerifier(Verifier): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,6 @@ | |
# | ||
# Luca Colagrande <[email protected]> | ||
|
||
from .scripts import datagen | ||
from .scripts.datagen import GemmDataGen | ||
|
||
__all__ = ['datagen'] | ||
__all__ = ['GemmDataGen'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,15 +9,13 @@ | |
# Luca Colagrande <[email protected]> | ||
|
||
import numpy as np | ||
import os | ||
import re | ||
import pyflexfloat as ff | ||
import sys | ||
|
||
sys.path.append(os.path.join(os.path.dirname(__file__), "../../../../util/sim/")) | ||
import data_utils # noqa: E402 | ||
from data_utils import DataGen, format_array_declaration, format_struct_definition, \ | ||
format_array_definition, format_ifdef_wrapper # noqa: E402 | ||
from snitch.util.sim import data_utils | ||
from snitch.util.sim.data_utils import DataGen, format_array_declaration, \ | ||
format_struct_definition, format_array_definition, format_ifdef_wrapper | ||
|
||
|
||
np.random.seed(42) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.