Added Makefile support

This commit is contained in:
John W. Terrell 2025-09-18 15:10:42 -07:00
parent c22d2639eb
commit 62b2318035
7 changed files with 87 additions and 0 deletions

14
Makefile Normal file
View File

@ -0,0 +1,14 @@
SRCDIRS :=
empty:=
space:=$(empty) $(empty)
dir := src
include $(dir)/module.mk
all: sim
sim_output_location:
mkdir -p build/sim/
sim: sim_output_location
bsc -u -p $(subst $(space):,:,$(SRCDIRS)) src/ESeries.bsv

21
shell.nix Normal file
View File

@ -0,0 +1,21 @@
let
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-25.05";
pkgs = import nixpkgs { config = {}; overlays = []; };
in
pkgs.mkShell {
# Dependencies that only exist in the build environment
nativeBuildInputs = with pkgs; [
bluespec
clang # for clang-format
];
# Dependencies that only exist in the runtime environment
buildInputs = with pkgs; [
];
shellHook =
''
# This provides git an email address for commits
export EMAIL="john@coolpeople.io"
'';
}

8
src/Cpu/CSRs/module.mk Normal file
View File

@ -0,0 +1,8 @@
sp := $(sp).x
dirstack_$(sp) := $(d)
d := $(dir)
SRCDIRS+=:$(d)
d := $(dirstack_$(sp))
sp := $(basename $(sp))

11
src/Cpu/module.mk Normal file
View File

@ -0,0 +1,11 @@
sp := $(sp).x
dirstack_$(sp) := $(d)
d := $(dir)
SRCDIRS+=:$(d)
dir := $(d)/CSRs
include $(dir)/module.mk
d := $(dirstack_$(sp))
sp := $(basename $(sp))

8
src/Memory/module.mk Normal file
View File

@ -0,0 +1,8 @@
sp := $(sp).x
dirstack_$(sp) := $(d)
d := $(dir)
SRCDIRS+=:$(d)
d := $(dirstack_$(sp))
sp := $(basename $(sp))

8
src/Util/module.mk Normal file
View File

@ -0,0 +1,8 @@
sp := $(sp).x
dirstack_$(sp) := $(d)
d := $(dir)
SRCDIRS+=:$(d)
d := $(dirstack_$(sp))
sp := $(basename $(sp))

17
src/module.mk Normal file
View File

@ -0,0 +1,17 @@
sp := $(sp).x
dirstack_$(sp) := $(d)
d := $(dir)
SRCDIRS+=:$(d)
dir := $(d)/Cpu
include $(dir)/module.mk
dir := $(d)/Memory
include $(dir)/module.mk
dir := $(d)/Util
include $(dir)/module.mk
d := $(dirstack_$(sp))
sp := $(basename $(sp))