Skip to content

Commit

Permalink
[PyCDE] Disabling Handshake-DC tests
Browse files Browse the repository at this point in the history
Since the DC flow is broken, disabling the test and flow.
http://github.com/llvm/circt/issues/7949
  • Loading branch information
teqdruid committed Jan 2, 2025
1 parent 328c0a3 commit 7b7a79b
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 18 deletions.
9 changes: 8 additions & 1 deletion frontends/PyCDE/integration_test/esi_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ def construct(ports):


class JoinAddFunc(Func):
# This test is broken since the DC dialect flow is broken. Leaving the code
# here in case it gets fixed in the future.
# https://github.com/llvm/circt/issues/7949 is the latest layer of the onion.

a = Input(UInt(32))
b = Input(UInt(32))
x = Output(UInt(32))
Expand All @@ -119,6 +123,7 @@ def construct(ports):


class Join(Module):
# This test is broken since the JoinAddFunc function is broken.
clk = Clock()
rst = Reset()

Expand All @@ -141,7 +146,9 @@ def construct(ports):
MMIOClient(i)()
MMIOReadWriteClient(clk=ports.clk, rst=ports.rst)
ConstProducer(clk=ports.clk, rst=ports.rst)
Join(clk=ports.clk, rst=ports.rst)

# Disable broken test.
# Join(clk=ports.clk, rst=ports.rst)


if __name__ == "__main__":
Expand Down
27 changes: 15 additions & 12 deletions frontends/PyCDE/integration_test/test_software/esi_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,18 @@ def read_offset_check(i: int, add_amt: int):
# Handshake JoinAddFunc tests
################################################################################

a = d.ports[esi.AppID("join_a")].write_port("data")
a.connect()
b = d.ports[esi.AppID("join_b")].write_port("data")
b.connect()
x = d.ports[esi.AppID("join_x")].read_port("data")
x.connect()

a.write(15)
b.write(24)
xdata = x.read()
print(f"join: {xdata}")
assert xdata == 15 + 24
# Disabled test since the DC dialect flow is broken. Leaving the code here in
# case someone fixes it.

# a = d.ports[esi.AppID("join_a")].write_port("data")
# a.connect()
# b = d.ports[esi.AppID("join_b")].write_port("data")
# b.connect()
# x = d.ports[esi.AppID("join_x")].read_port("data")
# x.connect()

# a.write(15)
# b.write(24)
# xdata = x.read()
# print(f"join: {xdata}")
# assert xdata == 15 + 24
11 changes: 10 additions & 1 deletion frontends/PyCDE/src/pycde/handshake.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

from __future__ import annotations
import sys
from typing import List, Optional, Dict, Tuple

from .module import Module, ModuleLikeBuilderBase, PortError
Expand Down Expand Up @@ -41,6 +42,10 @@ def create_op(self, sys: System, symbol):
def generate(self):
"""Fill in (generate) this module. Only supports a single generator
currently."""

print(
sys.stderr, "WARNING: the Func handshake flow is currently broken "
"and thus disabled.")
if len(self.generators) != 1:
raise ValueError("Must have exactly one generator.")
g: Generator = list(self.generators.values())[0]
Expand Down Expand Up @@ -121,7 +126,11 @@ class Func(Module):
to hardware design.
The PyCDE interface to it (this class) is considered experimental. Use at your
own risk and test the resulting RTL thoroughly."""
own risk and test the resulting RTL thoroughly.
Warning: the DC flow is currently broken and thus disabled. Do not use this.
https://github.com/llvm/circt/issues/7949
"""

BuilderType: type[ModuleLikeBuilderBase] = FuncBuilder
_builder: FuncBuilder
Expand Down
13 changes: 9 additions & 4 deletions frontends/PyCDE/src/pycde/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,15 @@ def get_instance(self,
lambda sys: TypeAlias.declare_aliases(sys.mod),

# Then run all the passes to lower dialects which produce `hw.module`s.
"builtin.module(lower-handshake-to-dc)",
"builtin.module(dc-materialize-forks-sinks)",
"builtin.module(lower-dc-to-hw)",
"builtin.module(map-arith-to-comb)",

# The DC flow is broken, so don't bother running these passes. Leaving
# them in case someone fixes it in the future.
# https://github.com/llvm/circt/issues/7949 is the latest layer of the
# onion.
# "builtin.module(lower-handshake-to-dc)",
# "builtin.module(dc-materialize-forks-sinks)",
# "builtin.module(lower-dc-to-hw)",
# "builtin.module(map-arith-to-comb)",

# Run ESI manifest passes.
"builtin.module(esi-appid-hier{{top={tops} }}, esi-build-manifest{{top={tops} }})",
Expand Down

0 comments on commit 7b7a79b

Please sign in to comment.