google / google/xls

ram model should have a working default word partition size

Open
#2,016 0 comments 0 reactions 0 assignees View on GitHub
app bug documentation ram 🧦 sox
Dominant language
C++
Stars
1.9k
Forks
283
Avg merge
2d 10h
Merged PRs (30d)
135

Description

**Describe the bug**

By default the ram model partition size is set to `0`:
https://github.com/google/xls/blob/def2cb14ba6f5525a0214ee29040e71c393bb239/xls/examples/ram.x#L165
while documented as `1` in:
https://github.com/google/xls/blob/def2cb14ba6f5525a0214ee29040e71c393bb239/xls/examples/ram.x#L148-L150

If left set as `0` it produce the following error:
```
third_party/xls/examples/ram.x:193:62-193:80
0191: // INITIALIZED is (false by
0192: // default, indicating no data has been written yet).
0193: bool[NUM_PARTITIONS][SIZE]:[bool[NUM_PARTITIONS]:[INITIALIZED, ...], ...]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^----------------^ XlsTypeError: Annotated array size 0 is too small for observed array member count 1
Type mismatch:
uN[1][0]
vs uN[1][1]
0194: )
0195: }
```

**To Reproduce**

```
spawn ram_model::RamModel(
ram_model_rd_req_r, ram_model_rd_resp_s, ram_model_wr_req_r,
ram_model_wr_resp_s);
```

**Expected behavior**

Instead I would expect the (documented and effective) default to be WORD_SIZE (only one partition).

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.