Skip to content

Commit

Permalink
Merge branch 'master' into piotro/litex-update
Browse files Browse the repository at this point in the history
  • Loading branch information
tilk authored Nov 25, 2024
2 parents 03bb123 + 2abd9e9 commit 62ee4ca
Show file tree
Hide file tree
Showing 112 changed files with 1,428 additions and 14,303 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ jobs:
# https://github.com/actions/runner/issues/2033
chown -R $(id -u):$(id -g) $PWD
- name: Checkout submodules
run: git submodule update --init --recursive amaranth-stubs

- name: Set up Python
uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -114,9 +111,6 @@ jobs:
# https://github.com/actions/runner/issues/2033
chown -R $(id -u):$(id -g) $PWD
- name: Checkout submodules
run: git submodule update --init --recursive amaranth-stubs

- name: Set up Python
uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -165,9 +159,6 @@ jobs:
# https://github.com/actions/runner/issues/2033
chown -R $(id -u):$(id -g) $PWD
- name: Checkout submodules
run: git submodule update --init --recursive amaranth-stubs

- name: Set up Python
uses: actions/setup-python@v5
with:
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/deploy_gh_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Checkout submodules
run: git submodule update --init --recursive amaranth-stubs

- name: Set up Python
uses: actions/setup-python@v5
with:
Expand Down
15 changes: 0 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Checkout submodules
run: git submodule update --init --recursive amaranth-stubs

- name: Set up Python
uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -153,9 +150,6 @@ jobs:
git config --global --add safe.directory /__w/coreblocks/coreblocks
git submodule > .gitmodules-hash
- name: Checkout submodules
run: git submodule update --init --recursive amaranth-stubs

- name: Set up Python
uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -263,9 +257,6 @@ jobs:
git config --global --add safe.directory /__w/coreblocks/coreblocks
git submodule > .gitmodules-hash
- name: Checkout submodules
run: git submodule update --init --recursive amaranth-stubs

- name: Set up Python
uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -318,9 +309,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Checkout submodules
run: git submodule update --init --recursive amaranth-stubs

- name: Set up Python
uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -353,9 +341,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Checkout submodules
run: git submodule update --init --recursive amaranth-stubs

- name: Set up Python
uses: actions/setup-python@v5
with:
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,3 @@
[submodule "test/external/riscof/riscv-arch-test"]
path = test/external/riscof/riscv-arch-test
url = https://github.com/riscv-non-isa/riscv-arch-test.git
[submodule "amaranth-stubs"]
path = amaranth-stubs
url = https://github.com/kuznia-rdzeni/amaranth-stubs.git
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Coreblocks is an experimental, modular out-of-order [RISC-V](https://riscv.org/s
* Simplicity. Coreblocks is an academic project, accessible to students.
It should be suitable for teaching essentials of out-of-order architectures.
* Modularity. We want to be able to easily experiment with the core by adding, replacing and modifying modules without changing the source too much.
For this goal, we designed a [transaction system](https://kuznia-rdzeni.github.io/coreblocks/Transactions.html) inspired by [Bluespec](http://wiki.bluespec.com/).
For this goal, we designed a transaction system called [Transactron](https://github.com/kuznia-rdzeni/transactron), which is inspired by [Bluespec](http://wiki.bluespec.com/).
* Fine-grained testing. Outside of the integration tests for the full core, modules are tested individually.
This is to support an agile style of development.

Expand All @@ -25,9 +25,6 @@ The core currently supports the full RV32I instruction set and several extension
Exceptions and some of machine-mode CSRs are supported, the support for interrupts is currently rudimentary and incompatible with the RISC-V spec.
Coreblocks can be used with [LiteX](https://github.com/enjoy-digital/litex) (currently using a [patched version](https://github.com/kuznia-rdzeni/litex/tree/coreblocks)).

The transaction system we use as the foundation for the core is well-tested and usable.
We plan to make it available as a separate Python package.

## Documentation

The [documentation for our project](https://kuznia-rdzeni.github.io/coreblocks/) is automatically generated using [Sphinx](https://www.sphinx-doc.org/).
Expand Down
1 change: 0 additions & 1 deletion amaranth-stubs
Submodule amaranth-stubs deleted from 480a38
9 changes: 5 additions & 4 deletions coreblocks/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ def __init__(self, *, gen_params: GenParams):
def elaborate(self, platform):
m = TModule()

connect(m, flipped(self.wb_instr), self.wb_master_instr.wb_master)
connect(m, flipped(self.wb_data), self.wb_master_data.wb_master)
connect(m.top_module, flipped(self.wb_instr), self.wb_master_instr.wb_master)
connect(m.top_module, flipped(self.wb_data), self.wb_master_data.wb_master)

m.submodules.wb_master_instr = self.wb_master_instr
m.submodules.wb_master_data = self.wb_master_data
Expand Down Expand Up @@ -140,8 +140,9 @@ def elaborate(self, platform):

m.submodules.exception_information_register = self.exception_information_register

if self.connections.dependency_provided(FetchResumeKey()):
fetch_resume_fb, fetch_resume_unifiers = self.connections.get_dependency(FetchResumeKey())
fetch_resume = self.connections.get_optional_dependency(FetchResumeKey())
if fetch_resume is not None:
fetch_resume_fb, fetch_resume_unifiers = fetch_resume
m.submodules.fetch_resume_unifiers = ModuleConnector(**fetch_resume_unifiers)

m.submodules.fetch_resume_connector = ConnectTrans(fetch_resume_fb, self.frontend.resume_from_unsafe)
Expand Down
7 changes: 3 additions & 4 deletions coreblocks/core_structs/rob.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from amaranth import *
from amaranth.lib.data import View
import amaranth.lib.memory as memory
from transactron import Method, Transaction, def_method, TModule
from transactron.lib.metrics import *
Expand All @@ -19,7 +18,7 @@ def __init__(self, gen_params: GenParams) -> None:
self.retire = Method()
self.done = Array(Signal() for _ in range(2**self.params.rob_entries_bits))
self.exception = Array(Signal() for _ in range(2**self.params.rob_entries_bits))
self.data = memory.Memory(shape=layouts.data_layout.size, depth=2**self.params.rob_entries_bits, init=[])
self.data = memory.Memory(shape=layouts.data_layout, depth=2**self.params.rob_entries_bits, init=[])
self.get_indices = Method(o=layouts.get_indices, nonexclusive=True)

self.perf_rob_wait_time = FIFOLatencyMeasurer(
Expand Down Expand Up @@ -54,8 +53,8 @@ def elaborate(self, platform):

@def_method(m, self.peek, ready=peek_possible)
def _():
return { # remove View after Amaranth upgrade
"rob_data": View(self.params.get(ROBLayouts).data_layout, read_port.data),
return {
"rob_data": read_port.data,
"rob_id": start_idx,
"exception": self.exception[start_idx],
}
Expand Down
5 changes: 3 additions & 2 deletions coreblocks/frontend/fetch/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,9 @@ def _():
expect_unstall_unsafe = Signal()
prev_stalled_unsafe = Signal()
dependencies = DependencyContext.get()
if dependencies.dependency_provided(FetchResumeKey()):
unifier_ready = DependencyContext.get().get_dependency(FetchResumeKey())[0].ready
fetch_resume = dependencies.get_optional_dependency(FetchResumeKey())
if fetch_resume is not None:
unifier_ready = fetch_resume[0].ready
else:
unifier_ready = C(0)

Expand Down
1 change: 0 additions & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@

```{eval-rst}
.. include:: modules-coreblocks.rst
.. include:: modules-transactron.rst
```
1 change: 0 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ maxdepth: 3
home.md
assumptions.md
development-environment.md
transactions.md
scheduler/overview.md
shared-structs/implementation/rs-impl.md
shared-structs/rs.md
Expand Down
Loading

0 comments on commit 62ee4ca

Please sign in to comment.