Skip to content

Commit

Permalink
Reformatted files
Browse files Browse the repository at this point in the history
  • Loading branch information
Hazardu committed Dec 17, 2024
1 parent c254ba7 commit c18f594
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions test/utils/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def test_popcount(self, size):
class CLZTestCircuit(Elaboratable):
def __init__(self, xlen: int):
self.sig_in = Signal(xlen)
self.sig_out = Signal(ceil_log2(xlen)+1)
self.sig_out = Signal(ceil_log2(xlen) + 1)
self.xlen = xlen

def elaborate(self, platform):
Expand Down Expand Up @@ -130,7 +130,7 @@ async def process(self, sim: TestbenchContext):
n = random.randrange(self.size)
self.check(sim, n)
sim.delay(1e-6)
self.check(sim, 2**self.size-1)
self.check(sim, 2**self.size - 1)

def test_count_leading_zeros(self, size):
with self.run_simulation(self.m) as sim:
Expand All @@ -140,7 +140,7 @@ def test_count_leading_zeros(self, size):
class CTZTestCircuit(Elaboratable):
def __init__(self, xlen: int):
self.sig_in = Signal(xlen)
self.sig_out = Signal(ceil_log2(xlen)+1)
self.sig_out = Signal(ceil_log2(xlen) + 1)
self.xlen = xlen

def elaborate(self, platform):
Expand Down
2 changes: 1 addition & 1 deletion transactron/utils/amaranth_ext/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def iter(s: Value, step: int) -> Value:

slen = len(s)
slen_log = ceil_log2(slen)
closest_pow_2_of_s = 2 ** slen_log
closest_pow_2_of_s = 2**slen_log
zeros_prepend_count = closest_pow_2_of_s - slen
value = iter(Cat(C(0, shape=zeros_prepend_count), s), slen_log)

Expand Down

0 comments on commit c18f594

Please sign in to comment.