Skip to content

Commit 673e7cc

Browse files
Update makefile
1 parent 5598bec commit 673e7cc

46 files changed

Lines changed: 137 additions & 857 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 26 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
1-
SCALA_MAIN_CLASS = caches.hardware.pipelined.SharedPipelinedCacheDe2115Top
1+
SCALA_MAIN_CLASS = caches.hardware.pipelined.SharedPipelinedCacheSynthTop
22
GENERATED_DIR = generated
3-
QUARTUS_PROJECT_DIR = quartus/SharedPipelinedCacheDe2115Top
4-
VERILOG_FILE = SharedPipelinedCacheDe2115Top.v
3+
QUARTUS_PROJECT_DIR = quartus/SharedPipelinedCacheSynthTop
4+
VERILOG_FILE = SharedPipelinedCacheSynthTop.v
5+
QUARTUS_PROJECT_NAME = SharedPipelinedCacheSynthTop
56

6-
SYNTH_TEST_SCALA_MAIN_CLASS = caches.hardware.pipelined.SharedPipelinedCacheSynthTop
7-
SYNTH_TEST_QUARTUS_PROJECT_DIR = quartus/SharedPipelinedCacheSynthTop
8-
SYNTH_TEST_QUARTUS_PROJECT_NAME = SharedPipelinedCacheSynthTop
9-
SYNTH_TEST_VERILOG_FILE = SharedPipelinedCacheSynthTop.v
10-
11-
# Default target
12-
buildhw: generate-verilog copy-to-quartus clean-generated
7+
all: test
138

149
# Run the sbt tests and test if quartus can synthesize the test module
1510
test: test-sbt test-synth
@@ -18,28 +13,25 @@ test-sbt:
1813
sbt test
1914

2015
# Test if quartus can successfully synthesis the test module
21-
test-synth: generate-test-synth-verilog synth-test-copy-to-quartus clean-generated synth-test
16+
test-synth: build-hw synth
2217

2318
# Synthesize the test level module
24-
synth-test:
25-
quartus_map $(SYNTH_TEST_QUARTUS_PROJECT_DIR)/$(SYNTH_TEST_QUARTUS_PROJECT_NAME)
26-
cat $(SYNTH_TEST_QUARTUS_PROJECT_DIR)/output_files/$(SYNTH_TEST_QUARTUS_PROJECT_NAME).map.summary
27-
quartus_fit $(SYNTH_TEST_QUARTUS_PROJECT_DIR)/$(SYNTH_TEST_QUARTUS_PROJECT_NAME)
28-
quartus_asm $(SYNTH_TEST_QUARTUS_PROJECT_DIR)/$(SYNTH_TEST_QUARTUS_PROJECT_NAME)
29-
quartus_sta $(SYNTH_TEST_QUARTUS_PROJECT_DIR)/$(SYNTH_TEST_QUARTUS_PROJECT_NAME)
19+
synth:
20+
quartus_map $(QUARTUS_PROJECT_DIR)/$(QUARTUS_PROJECT_NAME)
21+
cat $(QUARTUS_PROJECT_DIR)/output_files/$(QUARTUS_PROJECT_NAME).map.summary
22+
quartus_fit $(QUARTUS_PROJECT_DIR)/$(QUARTUS_PROJECT_NAME)
23+
quartus_asm $(QUARTUS_PROJECT_DIR)/$(QUARTUS_PROJECT_NAME)
24+
quartus_sta $(QUARTUS_PROJECT_DIR)/$(QUARTUS_PROJECT_NAME)
25+
26+
# Build hardware
27+
build-hw: clean-generated clean-quartus generate-verilog copy-to-quartus
3028

3129
# Generate Verilog for main top level module
3230
generate-verilog:
3331
@echo "Generating Verilog from $(SCALA_MAIN_CLASS)..."
3432
@mkdir -p $(GENERATED_DIR)
3533
sbt "runMain $(SCALA_MAIN_CLASS)"
3634

37-
# Generate Verilog for synthesis test module
38-
generate-test-synth-verilog:
39-
@echo "Generating Verilog from $(SYNTH_TEST_SCALA_MAIN_CLASS)..."
40-
@mkdir -p $(GENERATED_DIR)
41-
sbt "runMain $(SYNTH_TEST_SCALA_MAIN_CLASS)"
42-
4335
# Copy generated Verilog main top level module to Quartus project
4436
copy-to-quartus: generate-verilog
4537
@echo "Copying $(VERILOG_FILE) to Quartus project..."
@@ -51,16 +43,6 @@ copy-to-quartus: generate-verilog
5143
exit 1; \
5244
fi
5345

54-
synth-test-copy-to-quartus: generate-test-synth-verilog
55-
@echo "Copying $(SYNTH_TEST_VERILOG_FILE) to Quartus project..."
56-
@if [ -f "$(GENERATED_DIR)/$(SYNTH_TEST_VERILOG_FILE)" ]; then \
57-
cp "$(GENERATED_DIR)/$(SYNTH_TEST_VERILOG_FILE)" "$(SYNTH_TEST_QUARTUS_PROJECT_DIR)/$(SYNTH_TEST_VERILOG_FILE)"; \
58-
echo "Successfully copied $(SYNTH_TEST_VERILOG_FILE) to $(SYNTH_TEST_QUARTUS_PROJECT_DIR)"; \
59-
else \
60-
echo "Error: $(GENERATED_DIR)/$(SYNTH_TEST_VERILOG_FILE) not found!"; \
61-
exit 1; \
62-
fi
63-
6446
# Clean generated files
6547
clean-generated:
6648
@echo "Cleaning generated files..."
@@ -76,31 +58,19 @@ clean-quartus:
7658
rm -f $(QUARTUS_PROJECT_DIR)/*.rpt
7759
rm -f $(QUARTUS_PROJECT_DIR)/*.summary
7860

79-
# Check if generated Verilog exists
80-
check-verilog:
81-
@if [ -f "$(GENERATED_DIR)/$(VERILOG_FILE)" ]; then \
82-
echo "$(VERILOG_FILE) exists in $(GENERATED_DIR)"; \
83-
ls -la "$(GENERATED_DIR)/$(VERILOG_FILE)"; \
84-
else \
85-
echo "$(VERILOG_FILE) not found in $(GENERATED_DIR)"; \
86-
fi
87-
8861
# Show help
8962
help:
9063
@echo "Available targets:"
91-
@echo " buildhw - Generate Verilog for main top level module and copy to Quartus project: $(QUARTUS_PROJECT_DIR)"
92-
@echo " test - Run sbt test and test synthesis"
93-
@echo " test-sbt - Run sbt test"
94-
@echo " test-synth - Generate Verilog for test module and synthesize with Quartus"
95-
@echo " synth-test - Synthesize test module in Quartus project: $(SYNTH_TEST_QUARTUS_PROJECT_DIR)"
96-
@echo " generate-verilog - Generate Verilog from Scala source"
97-
@echo " generate-test-synth-verilog - Generate Verilog for test module"
98-
@echo " copy-to-quartus - Copy generated Verilog to Quartus project"
99-
@echo " synth-test-copy-to-quartus - Copy generated test module Verilog to Quartus project"
100-
@echo " check-verilog - Check if generated Verilog file exists"
101-
@echo " clean - Clean generated files and build artifacts"
102-
@echo " clean-quartus - Clean Quartus project files (use with caution)"
103-
@echo " help - Show this help message"
64+
@echo " test - Run sbt test and test synthesis;"
65+
@echo " test-sbt - Run sbt test;"
66+
@echo " test-synth - Test synthesis;"
67+
@echo " synth - Synthesize test module in Quartus project: $(QUARTUS_PROJECT_DIR);"
68+
@echo " build-hw - Generate Verilog for top level module and copy to Quartus project: $(QUARTUS_PROJECT_DIR);"
69+
@echo " generate-verilog - Generate Verilog for top level module: $(SCALA_MAIN_CLASS);"
70+
@echo " copy-to-quartus - Copy generated Verilog to Quartus project: $(QUARTUS_PROJECT_DIR);"
71+
@echo " clean-generated - Clean $(GENERATED_DIR) directory;"
72+
@echo " clean-quartus - Clean Quartus project: $(QUARTUS_PROJECT_DIR);"
73+
@echo " help - Show this help message."
10474

10575
# Phony targets
106-
.PHONY: generate-verilog copy-to-quartus clean clean-quartus check-verilog help
76+
.PHONY: all test test-sbt test-synth synth build-hw generate-verilog copy-to-quartus clean-generated clean-quartus help

quartus/SharedPipelinedCacheDe2115Top/.gitignore

Lines changed: 0 additions & 50 deletions
This file was deleted.

quartus/SharedPipelinedCacheDe2115Top/DE115.sdc

Lines changed: 0 additions & 85 deletions
This file was deleted.

quartus/SharedPipelinedCacheDe2115Top/SharedPipelinedCacheTopDe2115.qpf

Lines changed: 0 additions & 31 deletions
This file was deleted.

quartus/SharedPipelinedCacheDe2115Top/SharedPipelinedCacheTopDe2115.qsf

Lines changed: 0 additions & 73 deletions
This file was deleted.

src/main/scala/caches/hardware/pipelined/CacheMemToOcpBurstMasterAdapter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package caches.hardware.pipelined
22

3-
import ocp._
43
import chisel3._
54
import chisel3.util._
5+
import ocp._
66

77
/**
88
* Wrapper for the L2 cache to the OCP burst interface.

src/main/scala/caches/hardware/pipelined/CacheMemory.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ import chisel3.util._
66

77
/**
88
* Cache memory module with byte-level write enable.
9-
* @param sizeInBytes Size of the cache memory in bytes
10-
* @param nWays Number of ways (associativity) in the cache
11-
* @param bytesPerBlock Number of bytes per cache block
9+
*
10+
* @param sizeInBytes Size of the cache memory in bytes
11+
* @param nWays Number of ways (associativity) in the cache
12+
* @param bytesPerBlock Number of bytes per cache block
1213
* @param bytesPerSubBlock Number of bytes per sub-block
1314
*/
1415
class CacheMemory(sizeInBytes: Int, nWays: Int, bytesPerBlock: Int, bytesPerSubBlock: Int) extends Module {

0 commit comments

Comments
 (0)