summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjjsuperpower <jjs29356@gmail.com>2022-08-15 15:23:00 -0500
committerjjsuperpower <jjs29356@gmail.com>2022-08-15 15:23:00 -0500
commit6c02607b0972976da182c2e7b318dd6f9c5baf20 (patch)
tree1526d1827bcfebd50df4ac68d5ab40bc1ff8fe7d
parentc3fbef6e64506057e832334e1dfa26efde67777e (diff)
added template
-rw-r--r--.vscode/configurationCache.log2
-rw-r--r--.vscode/dryrun.log4
-rw-r--r--.vscode/targets.log85
-rw-r--r--hdl/shift_reg.py4
-rw-r--r--hdl/template.py36
5 files changed, 81 insertions, 50 deletions
diff --git a/.vscode/configurationCache.log b/.vscode/configurationCache.log
index 7272748..2908cc5 100644
--- a/.vscode/configurationCache.log
+++ b/.vscode/configurationCache.log
@@ -1 +1 @@
-{"buildTargets":["cc","clean","test","test-w"],"launchTargets":[],"customConfigurationProvider":{"workspaceBrowse":{"browsePath":[],"compilerArgs":[]},"fileIndex":[]}} \ No newline at end of file
+{"buildTargets":["cc","clean","sim","test","test-w"],"launchTargets":[],"customConfigurationProvider":{"workspaceBrowse":{"browsePath":[],"compilerArgs":[]},"fileIndex":[]}} \ No newline at end of file
diff --git a/.vscode/dryrun.log b/.vscode/dryrun.log
index 3712119..9bcad8c 100644
--- a/.vscode/dryrun.log
+++ b/.vscode/dryrun.log
@@ -1,5 +1,5 @@
-make --dry-run --keep-going --print-directory
+make --dry-run --always-make --keep-going --print-directory
make: Entering directory '/home/jon/github/ASAP32'
-python3 hdl/shift_reg.py cc hdl/shift_reg
+python3 hdl/shift_reg.py sim
make: Leaving directory '/home/jon/github/ASAP32'
diff --git a/.vscode/targets.log b/.vscode/targets.log
index 29b4ebe..8749a31 100644
--- a/.vscode/targets.log
+++ b/.vscode/targets.log
@@ -8,13 +8,11 @@ make: *** No rule to make target 'all'. Stop.
# This is free software: you are free to change and redistribute it.
# There is NO WARRANTY, to the extent permitted by law.
-# Make data base, printed on Wed Aug 10 22:11:46 2022
+# Make data base, printed on Mon Aug 15 15:20:54 2022
# Variables
# environment
-PROVIDE_FULLSTACK_ACTION = true
-# environment
JAVA_HOME = /usr/lib64/jvm/java
# environment
QEMU_AUDIO_DRV = pa
@@ -29,8 +27,6 @@ NO_AT_BRIDGE = 1
# environment
GTK_RC_FILES = /etc/gtk/gtkrc:/home/jon/.gtkrc:/home/jon/.config/gtkrc
# environment
-UUID = 30e4f429-d9ff-4340-ac46-25a56c8ba58c
-# environment
WINDOWMANAGER = /usr/bin/startplasma-x11
# environment
VSCODE_CWD = /home/jon
@@ -40,8 +36,6 @@ GPG_TTY = not a tty
MACHTYPE = x86_64-suse-linux
# default
MAKE_COMMAND := make
-# environment
-THREE_SCALE_USER_TOKEN = 207c527cfc2a6b8dcf4fa43ad7a976da
# automatic
@D = $(patsubst %/,%,$(dir $@))
# environment
@@ -83,7 +77,7 @@ SSH_ASKPASS = /usr/libexec/ssh/ssh-askpass
# environment
LANG = C
# environment
-XAUTHORITY = /run/user/1000/xauth_xKCqdm
+XAUTHORITY = /run/user/1000/xauth_QWvpuc
# environment
MANPATHISSET = yes
# default
@@ -97,9 +91,7 @@ MAKEFLAGS = pqrR
# makefile
CURDIR := /home/jon/github/ASAP32
# environment
-UTM_SOURCE = vscode
-# environment
-APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL = 1
+APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL = true
# environment
LESSOPEN = lessopen.sh %s
# automatic
@@ -107,7 +99,7 @@ LESSOPEN = lessopen.sh %s
# environment
MFLAGS = -pqrR
# environment
-SSH_AUTH_SOCK = /tmp/ssh-XXXXXX5VtrVN/agent.1680
+SSH_AUTH_SOCK = /tmp/ssh-XXXXXXkett0U/agent.1979
# default
.SHELLFLAGS := -c
# environment
@@ -127,7 +119,7 @@ MAKEFILE_LIST := Makefile
# automatic
@F = $(notdir $@)
# environment
-VSCODE_PID = 20613
+VSCODE_PID = 6093
# environment
XDG_SESSION_TYPE = x11
# environment
@@ -139,7 +131,7 @@ INPUT_METHOD = ibus
# environment
SDK_HOME = /usr/lib64/jvm/java
# environment
-SESSION_MANAGER = local/WarpDrive:@/tmp/.ICE-unix/2057,unix/WarpDrive:/tmp/.ICE-unix/2057
+SESSION_MANAGER = local/WarpDrive:@/tmp/.ICE-unix/2263,unix/WarpDrive:/tmp/.ICE-unix/2263
# automatic
*F = $(notdir $*)
# environment
@@ -147,7 +139,7 @@ MANPATH = /home/jon/.local/share/man:/usr/local/man:/usr/local/share/man:/usr/sh
# environment
CHROME_DESKTOP = code-url-handler.desktop
# environment
-DBUS_SESSION_BUS_ADDRESS = unix:abstract=/tmp/dbus-E50q4J8Dmj,guid=72916cd557b4aa5740f764f362f2a65e
+DBUS_SESSION_BUS_ADDRESS = unix:abstract=/tmp/dbus-WsMJbPZXWc,guid=299e3b57631cde650339f25862faa8c5
# automatic
<D = $(patsubst %/,%,$(dir $<))
# environment
@@ -191,8 +183,6 @@ MINICOM = -c on
# environment
CPU = x86_64
# environment
-RECOMMENDER_API_URL = https://gw.api.openshift.io//api/v2
-# environment
LESSCLOSE = lessclose.sh %s %s
# automatic
?F = $(notdir $?)
@@ -235,11 +225,11 @@ AUDIODRIVER = pulseaudio
# environment
G_FILENAME_ENCODING = @locale,UTF-8,ISO-8859-15,CP1252
# environment
-PLATFORMIO_PATH = /home/jon/.platformio/penv/bin:/home/jon/.platformio/penv:/home/jon/.platformio/python3/bin:/home/jon/.local/bin:/usr/local/bin:/usr/bin:/bin:/opt/cross/bin
+PLATFORMIO_PATH = /home/jon/.platformio/python3/bin:/home/jon/.local/bin:/usr/local/bin:/usr/bin:/bin:/opt/cross/bin
# environment
XDG_VTNR = 7
# makefile
-.DEFAULT_GOAL := cc
+.DEFAULT_GOAL := sim
# environment
DISPLAY = :0
# environment
@@ -251,7 +241,7 @@ MAKE_VERSION := 4.3
# environment
KDE_SESSION_UID = 1000
# environment
-SSH_AGENT_PID = 1790
+SSH_AGENT_PID = 2123
# environment
PAGER = less
# environment
@@ -263,8 +253,6 @@ G_BROKEN_FILENAMES = 1
# makefile (from 'Makefile', line 3)
HDL = $(wildcard $(HDL_FOLDER)/*.py)
# environment
-GOLANG_EXECUTABLE = go
-# environment
XDG_SESSION_CLASS = user
# environment
VSCODE_AMD_ENTRYPOINT = vs/workbench/api/node/extensionHostProcess
@@ -303,22 +291,20 @@ SUFFIXES :=
# environment
QT_AUTO_SCREEN_SCALE_FACTOR = 0
# environment
-TELEMETRY_ID = b829c4ad-e5b7-4d5d-8ec4-ffd388ea5201
-# environment
LS_OPTIONS = -N --color=tty -T 0
# environment
KDE_SESSION_VERSION = 5
# default
+
.FEATURES := target-specific order-only second-expansion else-if shortest-stem undefine oneshell nocomment grouped-target extra-prereqs archives jobserver output-sync check-symlink load
# environment
QT4_IM_MODULE = xim
# environment
-
KDE_FULL_SESSION = true
# environment
JRE_HOME = /usr/lib64/jvm/java
# variable set hash-table stats:
-# Load=152/1024=15%, Rehash=0, Collisions=19/186=10%
+# Load=145/1024=14%, Rehash=0, Collisions=21/181=12%
# Pattern-specific Variable Values
@@ -326,10 +312,10 @@ JRE_HOME = /usr/lib64/jvm/java
# Directories
-# ./hdl (device 65025, inode 22952540): 8 files, no impossibilities.
+# ./hdl (device 65025, inode 22952540): 7 files, no impossibilities.
# . (device 65025, inode 21757987): 12 files, no impossibilities.
-# 20 files, no impossibilities in 2 directories.
+# 19 files, no impossibilities in 2 directories.
# Implicit Rules
@@ -341,15 +327,22 @@ test-w:
# Implicit rule search has not been done.
# Modification time never checked.
# File has not been updated.
-# recipe to execute (from 'Makefile', line 15):
+# recipe to execute (from 'Makefile', line 18):
py.test -v $(HDL)
-v: hdl/shift_reg.py hdl/utils.py
+v: hdl/shift_reg.py hdl/template.py hdl/utils.py
# Implicit rule search has not been done.
# Modification time never checked.
# File has not been updated.
-# recipe to execute (from 'Makefile', line 9):
- python3 $< v $(basename $< .py)
+# recipe to execute (from 'Makefile', line 12):
+ python3 $< v
+
+sim: hdl/shift_reg.py hdl/template.py hdl/utils.py
+# Implicit rule search has not been done.
+# Modification time never checked.
+# File has not been updated.
+# recipe to execute (from 'Makefile', line 6):
+ python3 $< sim
# Not a target:
hdl/shift_reg.py:
@@ -360,7 +353,7 @@ hdl/shift_reg.py:
# Not a target:
Makefile:
# Implicit rule search has been done.
-# Last modified 2022-08-10 22:11:10.968940293
+# Last modified 2022-08-10 22:15:54.44768441
# File has been updated.
# Successfully updated.
@@ -368,7 +361,7 @@ clean:
# Implicit rule search has not been done.
# Modification time never checked.
# File has not been updated.
-# recipe to execute (from 'Makefile', line 18):
+# recipe to execute (from 'Makefile', line 21):
$(RM) -rf $(HDL_FOLDER)/*.cc $(HDL_FOLDER)/*.v $(HDL_FOLDER)/*.vcd
# Not a target:
@@ -394,30 +387,36 @@ test:
# Implicit rule search has not been done.
# Modification time never checked.
# File has not been updated.
-# recipe to execute (from 'Makefile', line 12):
+# recipe to execute (from 'Makefile', line 15):
py.test --disable-pytest-warnings -v $(HDL)
-cc: hdl/shift_reg.py hdl/utils.py
+# Not a target:
+hdl/template.py:
# Implicit rule search has not been done.
# Modification time never checked.
# File has not been updated.
-# recipe to execute (from 'Makefile', line 6):
+
+cc: hdl/shift_reg.py hdl/template.py hdl/utils.py
+# Implicit rule search has not been done.
+# Modification time never checked.
+# File has not been updated.
+# recipe to execute (from 'Makefile', line 9):
python3 $< cc $(basename $< .py)
# files hash-table stats:
-# Load=11/1024=1%, Rehash=0, Collisions=0/25=0%
+# Load=13/1024=1%, Rehash=0, Collisions=0/32=0%
# VPATH Search Paths
# No 'vpath' search paths.
# No general ('VPATH' variable) search path.
-# strcache buffers: 1 (0) / strings = 30 / storage = 261 B / avg = 8 B
-# current buf: size = 8162 B / used = 261 B / count = 30 / avg = 8 B
+# strcache buffers: 1 (0) / strings = 32 / storage = 281 B / avg = 8 B
+# current buf: size = 8162 B / used = 281 B / count = 32 / avg = 8 B
-# strcache performance: lookups = 44 / hit rate = 31%
+# strcache performance: lookups = 50 / hit rate = 36%
# hash-table stats:
-# Load=30/8192=0%, Rehash=0, Collisions=0/44=0%
-# Finished Make data base on Wed Aug 10 22:11:46 2022
+# Load=32/8192=0%, Rehash=0, Collisions=0/50=0%
+# Finished Make data base on Mon Aug 15 15:20:54 2022
diff --git a/hdl/shift_reg.py b/hdl/shift_reg.py
index dedc56b..40af39b 100644
--- a/hdl/shift_reg.py
+++ b/hdl/shift_reg.py
@@ -1,8 +1,4 @@
-import sys
-from wsgiref.util import shift_path_info
from amaranth import *
-from amaranth.back import verilog, cxxrtl
-from amaranth.cli import main
from amaranth.sim import Simulator, Settle, Delay
from utils import cmd
diff --git a/hdl/template.py b/hdl/template.py
new file mode 100644
index 0000000..5df554c
--- /dev/null
+++ b/hdl/template.py
@@ -0,0 +1,36 @@
+from amaranth import *
+from amaranth.sim import Simulator, Settle, Delay
+
+from utils import cmd
+
+class Template(Elaboratable):
+ def __init__(self):
+ ...
+
+ self.ports = [...]
+
+ def elaborate(self, platform):
+ m = Module()
+
+ ...
+
+ return m
+
+def test(filename="out.vcd"):
+ dut = ...
+
+ def proc1():
+ ...
+
+
+ sim = Simulator(dut)
+ sim.add_clock(1e-6)
+ sim.add_sync_process(proc1)
+
+ with sim.write_vcd(filename):
+ sim.run()
+
+
+if __name__ == '__main__':
+ shift_reg = Template(8)
+ cmd(shift_reg, test) \ No newline at end of file