google / google/xls

Schedule output doesn't match the example comments

Open
#4,989 0 comments 0 reactions 1 assignee Claimed by @proppy View on GitHub
Dominant language
C++
Stars
1.9k
Forks
283
Avg merge
2d 10h
Merged PRs (30d)
135

Description

On the "learn xls" tutorial I ran this example (block [12] in book):
```
%%dslx --top=muladd8 --clock_period_ps=1000
// set a more generous target clock frequency to `1000`ps.

import std;

fn muladd(a: uN[N], b: uN[N], c: uN[N]) -> (uN[N+N], u1) {
let product = std::umul(a, b);
let sum_with_carry = std::uadd(product, c);
let sum = sum_with_carry[0:N as s32 * s32:2];
let carry_bit = sum_with_carry[N+:u1];
(sum, carry_bit)
}

fn muladd8(a: u8, b: u8, c: u8) -> (u16, u1) {
muladd(a, b, c)
}

#[test]
fn adders_test() {
assert_eq(muladd8(u8:1, u8:2, u8:3), (u16:5 , u1:0));
}

// schedule tab ↓ shows a single pipeline stage with `product` and `sum_with_carry`.
```

Despite the last comment, i see two stages in the schedule tab:

Image

AFAIU it's because the sum of node_delay_ps for `product` and `sum_with_carry` doesn't add up to a 1000?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.