cocotbext-umi 0.0.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,90 @@
1
+ import dataclasses
2
+
3
+
4
+ class BitField:
5
+
6
+ def __init__(self, value, width, offset=0):
7
+ self._value = value
8
+ self._width = width
9
+ self._offset = offset
10
+
11
+ def __int__(self):
12
+ return self._value
13
+
14
+ def from_int(self, value):
15
+ if value >= 2**self.width:
16
+ raise ValueError(f"Value '{value}' to large for BitField of width {self._width}")
17
+ self._value = value
18
+
19
+ @property
20
+ def value(self):
21
+ return self.__int__()
22
+
23
+ @value.setter
24
+ def value(self, value):
25
+ self.from_int(value)
26
+
27
+ @property
28
+ def width(self):
29
+ return self._width
30
+
31
+ @property
32
+ def msb_idx(self):
33
+ return self._offset + self._width
34
+
35
+ @property
36
+ def lsb_idx(self):
37
+ return self._offset
38
+
39
+ def __add__(self, other):
40
+ if isinstance(other, BitField):
41
+ return BitField(
42
+ value=(int(self) << self.lsb_idx) | (int(other) << other.lsb_idx),
43
+ width=max(self.msb_idx, other.msb_idx) - min(self.lsb_idx, other.lsb_idx),
44
+ offset=min(self._offset, other._offset)
45
+ )
46
+ else:
47
+ return NotImplemented
48
+
49
+
50
+ class BitVector:
51
+
52
+ def as_bit_field(self):
53
+ return sum(
54
+ [getattr(self, field.name) for field in dataclasses.fields(self)],
55
+ start=BitField(value=0, width=0)
56
+ )
57
+
58
+ @classmethod
59
+ def from_int(cls, value):
60
+ c = cls()
61
+ for bit_field in [getattr(c, field.name) for field in dataclasses.fields(c)]:
62
+ bit_field.value = (value >> bit_field.lsb_idx) & ((1 << bit_field.width) - 1)
63
+ return c
64
+
65
+ @classmethod
66
+ def from_bytes(cls, value):
67
+ return cls.from_int(int.from_bytes(value, byteorder='little'))
68
+
69
+ @classmethod
70
+ def from_fields(cls, **kwargs):
71
+ c = cls()
72
+ for name, value in kwargs.items():
73
+ if hasattr(c, name):
74
+ bit_field = getattr(c, name)
75
+ bit_field.value = value
76
+ else:
77
+ raise TypeError(f"BitField '{name}' not found in {cls}")
78
+ return c
79
+
80
+ def __int__(self):
81
+ return int(self.as_bit_field())
82
+
83
+ def __bytes__(self):
84
+ return int.to_bytes(int(self), length=4, byteorder='little')
85
+
86
+ def __repr__(self):
87
+ rtn = ""
88
+ for key, value in dataclasses.asdict(self).items():
89
+ rtn += f"{key} = {int(value)} "
90
+ return rtn
@@ -0,0 +1,25 @@
1
+ import math
2
+ import random
3
+
4
+
5
+ def random_toggle_generator(on_range=(0, 15), off_range=(0, 15)):
6
+ return bit_toggler_generator(
7
+ gen_on=(random.randint(*on_range) for _ in iter(int, 1)),
8
+ gen_off=(random.randint(*off_range) for _ in iter(int, 1))
9
+ )
10
+
11
+
12
+ def sine_wave_generator(amplitude, w, offset=0):
13
+ while True:
14
+ for idx in (i / float(w) for i in range(int(w))):
15
+ yield amplitude * math.sin(2 * math.pi * idx) + offset
16
+
17
+
18
+ def bit_toggler_generator(gen_on, gen_off):
19
+ for n_on, n_off in zip(gen_on, gen_off):
20
+ yield int(abs(n_on)), int(abs(n_off))
21
+
22
+
23
+ def wave_generator(on_ampl=30, on_freq=200, off_ampl=10, off_freq=100):
24
+ return bit_toggler_generator(sine_wave_generator(on_ampl, on_freq),
25
+ sine_wave_generator(off_ampl, off_freq))
@@ -0,0 +1,10 @@
1
+ import dataclasses
2
+ from typing import Optional
3
+
4
+
5
+ @dataclasses.dataclass
6
+ class VRDTransaction:
7
+ data: bytes
8
+ strb: Optional[str] = None
9
+ len: Optional[int] = None
10
+ last: Optional[bool] = None
@@ -0,0 +1,485 @@
1
+ Metadata-Version: 2.4
2
+ Name: cocotbext-umi
3
+ Version: 0.0.2
4
+ Summary: Library of useful cocotb functions
5
+ Author: Zero ASIC
6
+ License: Apache License
7
+ Version 2.0, January 2004
8
+ http://www.apache.org/licenses/
9
+
10
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
11
+
12
+ 1. Definitions.
13
+
14
+ "License" shall mean the terms and conditions for use, reproduction,
15
+ and distribution as defined by Sections 1 through 9 of this document.
16
+
17
+ "Licensor" shall mean the copyright owner or entity authorized by
18
+ the copyright owner that is granting the License.
19
+
20
+ "Legal Entity" shall mean the union of the acting entity and all
21
+ other entities that control, are controlled by, or are under common
22
+ control with that entity. For the purposes of this definition,
23
+ "control" means (i) the power, direct or indirect, to cause the
24
+ direction or management of such entity, whether by contract or
25
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
26
+ outstanding shares, or (iii) beneficial ownership of such entity.
27
+
28
+ "You" (or "Your") shall mean an individual or Legal Entity
29
+ exercising permissions granted by this License.
30
+
31
+ "Source" form shall mean the preferred form for making modifications,
32
+ including but not limited to software source code, documentation
33
+ source, and configuration files.
34
+
35
+ "Object" form shall mean any form resulting from mechanical
36
+ transformation or translation of a Source form, including but
37
+ not limited to compiled object code, generated documentation,
38
+ and conversions to other media types.
39
+
40
+ "Work" shall mean the work of authorship, whether in Source or
41
+ Object form, made available under the License, as indicated by a
42
+ copyright notice that is included in or attached to the work
43
+ (an example is provided in the Appendix below).
44
+
45
+ "Derivative Works" shall mean any work, whether in Source or Object
46
+ form, that is based on (or derived from) the Work and for which the
47
+ editorial revisions, annotations, elaborations, or other modifications
48
+ represent, as a whole, an original work of authorship. For the purposes
49
+ of this License, Derivative Works shall not include works that remain
50
+ separable from, or merely link (or bind by name) to the interfaces of,
51
+ the Work and Derivative Works thereof.
52
+
53
+ "Contribution" shall mean any work of authorship, including
54
+ the original version of the Work and any modifications or additions
55
+ to that Work or Derivative Works thereof, that is intentionally
56
+ submitted to the Licensor for inclusion in the Work by the copyright owner
57
+ or by an individual or Legal Entity authorized to submit on behalf of
58
+ the copyright owner. For the purposes of this definition, "submitted"
59
+ means any form of electronic, verbal, or written communication sent
60
+ to the Licensor or its representatives, including but not limited to
61
+ communication on electronic mailing lists, source code control systems,
62
+ and issue tracking systems that are managed by, or on behalf of, the
63
+ Licensor for the purpose of discussing and improving the Work, but
64
+ excluding communication that is conspicuously marked or otherwise
65
+ designated in writing by the copyright owner as "Not a Contribution."
66
+
67
+ "Contributor" shall mean Licensor and any individual or Legal Entity
68
+ on behalf of whom a Contribution has been received by Licensor and
69
+ subsequently incorporated within the Work.
70
+
71
+ 2. Grant of Copyright License. Subject to the terms and conditions of
72
+ this License, each Contributor hereby grants to You a perpetual,
73
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
74
+ copyright license to reproduce, prepare Derivative Works of,
75
+ publicly display, publicly perform, sublicense, and distribute the
76
+ Work and such Derivative Works in Source or Object form.
77
+
78
+ 3. Grant of Patent License. Subject to the terms and conditions of
79
+ this License, each Contributor hereby grants to You a perpetual,
80
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
81
+ (except as stated in this section) patent license to make, have made,
82
+ use, offer to sell, sell, import, and otherwise transfer the Work,
83
+ where such license applies only to those patent claims licensable
84
+ by such Contributor that are necessarily infringed by their
85
+ Contribution(s) alone or by combination of their Contribution(s)
86
+ with the Work to which such Contribution(s) was submitted. If You
87
+ institute patent litigation against any entity (including a
88
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
89
+ or a Contribution incorporated within the Work constitutes direct
90
+ or contributory patent infringement, then any patent licenses
91
+ granted to You under this License for that Work shall terminate
92
+ as of the date such litigation is filed.
93
+
94
+ 4. Redistribution. You may reproduce and distribute copies of the
95
+ Work or Derivative Works thereof in any medium, with or without
96
+ modifications, and in Source or Object form, provided that You
97
+ meet the following conditions:
98
+
99
+ (a) You must give any other recipients of the Work or
100
+ Derivative Works a copy of this License; and
101
+
102
+ (b) You must cause any modified files to carry prominent notices
103
+ stating that You changed the files; and
104
+
105
+ (c) You must retain, in the Source form of any Derivative Works
106
+ that You distribute, all copyright, patent, trademark, and
107
+ attribution notices from the Source form of the Work,
108
+ excluding those notices that do not pertain to any part of
109
+ the Derivative Works; and
110
+
111
+ (d) If the Work includes a "NOTICE" text file as part of its
112
+ distribution, then any Derivative Works that You distribute must
113
+ include a readable copy of the attribution notices contained
114
+ within such NOTICE file, excluding those notices that do not
115
+ pertain to any part of the Derivative Works, in at least one
116
+ of the following places: within a NOTICE text file distributed
117
+ as part of the Derivative Works; within the Source form or
118
+ documentation, if provided along with the Derivative Works; or,
119
+ within a display generated by the Derivative Works, if and
120
+ wherever such third-party notices normally appear. The contents
121
+ of the NOTICE file are for informational purposes only and
122
+ do not modify the License. You may add Your own attribution
123
+ notices within Derivative Works that You distribute, alongside
124
+ or as an addendum to the NOTICE text from the Work, provided
125
+ that such additional attribution notices cannot be construed
126
+ as modifying the License.
127
+
128
+ You may add Your own copyright statement to Your modifications and
129
+ may provide additional or different license terms and conditions
130
+ for use, reproduction, or distribution of Your modifications, or
131
+ for any such Derivative Works as a whole, provided Your use,
132
+ reproduction, and distribution of the Work otherwise complies with
133
+ the conditions stated in this License.
134
+
135
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
136
+ any Contribution intentionally submitted for inclusion in the Work
137
+ by You to the Licensor shall be under the terms and conditions of
138
+ this License, without any additional terms or conditions.
139
+ Notwithstanding the above, nothing herein shall supersede or modify
140
+ the terms of any separate license agreement you may have executed
141
+ with Licensor regarding such Contributions.
142
+
143
+ 6. Trademarks. This License does not grant permission to use the trade
144
+ names, trademarks, service marks, or product names of the Licensor,
145
+ except as required for reasonable and customary use in describing the
146
+ origin of the Work and reproducing the content of the NOTICE file.
147
+
148
+ 7. Disclaimer of Warranty. Unless required by applicable law or
149
+ agreed to in writing, Licensor provides the Work (and each
150
+ Contributor provides its Contributions) on an "AS IS" BASIS,
151
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
152
+ implied, including, without limitation, any warranties or conditions
153
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
154
+ PARTICULAR PURPOSE. You are solely responsible for determining the
155
+ appropriateness of using or redistributing the Work and assume any
156
+ risks associated with Your exercise of permissions under this License.
157
+
158
+ 8. Limitation of Liability. In no event and under no legal theory,
159
+ whether in tort (including negligence), contract, or otherwise,
160
+ unless required by applicable law (such as deliberate and grossly
161
+ negligent acts) or agreed to in writing, shall any Contributor be
162
+ liable to You for damages, including any direct, indirect, special,
163
+ incidental, or consequential damages of any character arising as a
164
+ result of this License or out of the use or inability to use the
165
+ Work (including but not limited to damages for loss of goodwill,
166
+ work stoppage, computer failure or malfunction, or any and all
167
+ other commercial damages or losses), even if such Contributor
168
+ has been advised of the possibility of such damages.
169
+
170
+ 9. Accepting Warranty or Additional Liability. While redistributing
171
+ the Work or Derivative Works thereof, You may choose to offer,
172
+ and charge a fee for, acceptance of support, warranty, indemnity,
173
+ or other liability obligations and/or rights consistent with this
174
+ License. However, in accepting such obligations, You may act only
175
+ on Your own behalf and on Your sole responsibility, not on behalf
176
+ of any other Contributor, and only if You agree to indemnify,
177
+ defend, and hold each Contributor harmless for any liability
178
+ incurred by, or claims asserted against, such Contributor by reason
179
+ of your accepting any such warranty or additional liability.
180
+
181
+ END OF TERMS AND CONDITIONS
182
+
183
+ APPENDIX: How to apply the Apache License to your work.
184
+
185
+ To apply the Apache License to your work, attach the following
186
+ boilerplate notice, with the fields enclosed by brackets "[]"
187
+ replaced with your own identifying information. (Don't include
188
+ the brackets!) The text should be enclosed in the appropriate
189
+ comment syntax for the file format. We also recommend that a
190
+ file or class name and description of purpose be included on the
191
+ same "printed page" as the copyright notice for easier
192
+ identification within third-party archives.
193
+
194
+ Copyright 2025 Zero ASIC Corporation
195
+
196
+ Licensed under the Apache License, Version 2.0 (the "License");
197
+ you may not use this file except in compliance with the License.
198
+ You may obtain a copy of the License at
199
+
200
+ http://www.apache.org/licenses/LICENSE-2.0
201
+
202
+ Unless required by applicable law or agreed to in writing, software
203
+ distributed under the License is distributed on an "AS IS" BASIS,
204
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
205
+ See the License for the specific language governing permissions and
206
+ limitations under the License.
207
+
208
+ Project-URL: Homepage, https://github.com/zeroasiccorp/cocotbext-umi
209
+ Requires-Python: >=3.10
210
+ Description-Content-Type: text/markdown
211
+ License-File: LICENSE
212
+ Requires-Dist: siliconcompiler>=0.35.0
213
+ Requires-Dist: cocotb==2.0.1
214
+ Requires-Dist: cocotb-bus==0.3.0
215
+ Provides-Extra: test
216
+ Requires-Dist: flake8>=5.0.0; extra == "test"
217
+ Requires-Dist: pytest>=6.2.4; extra == "test"
218
+ Requires-Dist: pytest-timeout>=2.1.0; extra == "test"
219
+ Dynamic: license-file
220
+
221
+ # cocotbext-umi
222
+
223
+ **Cocotb Extensions for UMI (Universal Memory Interface) Verification**
224
+
225
+ [![Lint](https://github.com/zeroasiccorp/cocotbext-umi/actions/workflows/lint.yml/badge.svg?branch=main)](https://github.com/zeroasiccorp/cocotbext-umi/actions/workflows/lint.yml)
226
+ [![Wheels](https://github.com/zeroasiccorp/cocotbext-umi/actions/workflows/wheels.yml/badge.svg?branch=main)](https://github.com/zeroasiccorp/cocotbext-umi/actions/workflows/wheels.yml)
227
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
228
+
229
+ ## Overview
230
+
231
+ cocotbext-umi is a Python library providing [cocotb](https://www.cocotb.org/) extensions for verifying hardware designs that use the [UMI (Universal Memory Interface)](https://github.com/zeroasiccorp/umi) protocol. It includes drivers, monitors, transaction models, and memory simulation components for comprehensive UMI testbench development.
232
+
233
+ ### What is UMI?
234
+
235
+ [UMI](https://github.com/zeroasiccorp/umi) is a transaction-based standard for accessing memory through request-response message exchange patterns. Key characteristics include:
236
+
237
+ - **Simple and universal** - A clean, address-based interface that makes everything addressable
238
+ - **Layered architecture** - Five abstraction layers (Protocol, Transaction, Signal, Link, Physical)
239
+ - **Flexible data handling** - Word sizes up to 1024 bits with up to 256 word transfers per transaction
240
+ - **Advanced features** - Atomic operations, QoS support, and protection/security modes
241
+ - **Independent channels** - Separate request and response paths for efficient pipelining
242
+
243
+ ## Features
244
+
245
+ | Feature | Description |
246
+ |---------|-------------|
247
+ | **SUMI Protocol** | Complete Simple UMI transaction model with all command types |
248
+ | **TUMI Support** | Transport UMI for large transaction fragmentation |
249
+ | **Cocotb Integration** | Native drivers and monitors for cocotb testbenches |
250
+ | **Memory Model** | Virtual memory device for request/response simulation |
251
+ | **Bit-level Utilities** | Flexible BitField and BitVector classes for protocol encoding |
252
+
253
+ ## Installation
254
+
255
+
256
+ ```bash
257
+ git clone https://github.com/zeroasiccorp/cocotbext-umi
258
+ cd cocotbext-umi
259
+ pip install -e .
260
+ ```
261
+
262
+ ## Architecture
263
+
264
+ ```
265
+ cocotbext-umi/
266
+ ├── sumi.py # SUMI protocol: commands, transactions, enums
267
+ ├── tumi.py # TUMI: transport-level transaction handling
268
+ ├── drivers/
269
+ │ └── sumi_driver.py # Cocotb driver for sending UMI transactions
270
+ ├── monitors/
271
+ │ └── sumi_monitor.py # Cocotb monitor for receiving UMI transactions
272
+ ├── models/
273
+ │ └── umi_memory_device.py # Virtual memory responder model
274
+ └── utils/
275
+ ├── bit_utils.py # BitField and BitVector utilities
276
+ ├── generators.py # Transaction generators
277
+ └── vrd_transaction.py # Valid-ready-data transaction wrapper
278
+ ```
279
+
280
+ ## Quick Start
281
+
282
+ ### Basic Testbench Setup
283
+
284
+ ```python
285
+ import cocotb
286
+ from cocotb.clock import Clock
287
+ from cocotb.triggers import RisingEdge
288
+
289
+ from cocotbext.umi.sumi import SumiCmd, SumiCmdType, SumiTransaction
290
+ from cocotbext.umi.drivers.sumi_driver import SumiDriver
291
+ from cocotbext.umi.monitors.sumi_monitor import SumiMonitor
292
+ from cocotbext.umi.models.umi_memory_device import UmiMemoryDevice
293
+
294
+ @cocotb.test()
295
+ async def test_umi_memory(dut):
296
+ # Start clock
297
+ cocotb.start_soon(Clock(dut.clk, 10, units="ns").start())
298
+
299
+ # Create driver and monitor
300
+ driver = SumiDriver(dut, "umi_req", dut.clk)
301
+ monitor = SumiMonitor(dut, "umi_resp", dut.clk)
302
+
303
+ # Create memory model
304
+ mem = UmiMemoryDevice(monitor, driver, log=dut._log)
305
+
306
+ # Reset
307
+ dut.rst.value = 1
308
+ await RisingEdge(dut.clk)
309
+ dut.rst.value = 0
310
+
311
+ # Send a write transaction
312
+ write_cmd = SumiCmd.from_fields(
313
+ cmd_type=SumiCmdType.UMI_REQ_WRITE,
314
+ size=2, # 4 bytes
315
+ len=0, # 1 transfer
316
+ eom=1
317
+ )
318
+ write_txn = SumiTransaction(
319
+ cmd=write_cmd,
320
+ da=0x1000,
321
+ sa=0x0,
322
+ data=bytes([0xDE, 0xAD, 0xBE, 0xEF])
323
+ )
324
+ driver.append(write_txn)
325
+ ```
326
+
327
+ ### Creating UMI Transactions
328
+
329
+ ```python
330
+ from cocotbext.umi.sumi import SumiCmd, SumiCmdType, SumiTransaction
331
+
332
+ # Create a read request
333
+ read_cmd = SumiCmd.from_fields(
334
+ cmd_type=SumiCmdType.UMI_REQ_READ,
335
+ size=3, # 8 bytes per word
336
+ len=3, # 4 transfers (len+1)
337
+ eom=1 # End of message
338
+ )
339
+
340
+ read_txn = SumiTransaction(
341
+ cmd=read_cmd,
342
+ da=0x2000, # Destination address
343
+ sa=0x100, # Source address (for response routing)
344
+ data=None # No data for read requests
345
+ )
346
+
347
+ # Create a posted write (no response expected)
348
+ posted_cmd = SumiCmd.from_fields(
349
+ cmd_type=SumiCmdType.UMI_REQ_POSTED,
350
+ size=0, # 1 byte
351
+ len=7, # 8 bytes total
352
+ eom=1
353
+ )
354
+
355
+ posted_txn = SumiTransaction(
356
+ cmd=posted_cmd,
357
+ da=0x3000,
358
+ sa=0x0,
359
+ data=bytes([0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08])
360
+ )
361
+ ```
362
+
363
+ ### Using TUMI for Large Transactions
364
+
365
+ ```python
366
+ from cocotbext.umi.tumi import TumiTransaction
367
+ from cocotbext.umi.sumi import SumiCmd, SumiCmdType
368
+
369
+ # Create a large transaction that needs fragmentation
370
+ cmd = SumiCmd.from_fields(cmd_type=SumiCmdType.UMI_REQ_WRITE)
371
+ large_data = bytes(range(256)) # 256 bytes
372
+
373
+ tumi_txn = TumiTransaction(
374
+ cmd=cmd,
375
+ da=0x4000,
376
+ sa=0x0,
377
+ data=large_data
378
+ )
379
+
380
+ # Convert to multiple SUMI transactions based on bus width
381
+ sumi_transactions = tumi_txn.to_sumi(data_bus_size=32) # 32-byte bus
382
+ for txn in sumi_transactions:
383
+ driver.append(txn)
384
+ ```
385
+
386
+ ## API Reference
387
+
388
+ ### SUMI Command Types
389
+
390
+ | Command | Value | Direction | Description |
391
+ |---------|-------|-----------|-------------|
392
+ | `UMI_REQ_READ` | 0x01 | Request | Read/load request |
393
+ | `UMI_REQ_WRITE` | 0x03 | Request | Write/store with acknowledgment |
394
+ | `UMI_REQ_POSTED` | 0x05 | Request | Posted write (no response) |
395
+ | `UMI_REQ_RDMA` | 0x07 | Request | Remote DMA command |
396
+ | `UMI_REQ_ATOMIC` | 0x09 | Request | Atomic read-modify-write |
397
+ | `UMI_REQ_ERROR` | 0x0F | Request | Error message |
398
+ | `UMI_REQ_LINK` | 0x2F | Request | Link control |
399
+ | `UMI_RESP_READ` | 0x02 | Response | Read response with data |
400
+ | `UMI_RESP_WRITE` | 0x04 | Response | Write acknowledgment |
401
+ | `UMI_RESP_LINK` | 0x0E | Response | Link control response |
402
+
403
+ ### SUMI Command Header (32-bit)
404
+
405
+ | Bits | Field | Description |
406
+ |------|-------|-------------|
407
+ | [4:0] | `cmd_type` | Command opcode |
408
+ | [7:5] | `size` | Word size (bytes = 2^SIZE) |
409
+ | [15:8] | `len` | Transfer count (LEN+1 words) |
410
+ | [19:16] | `qos` | Quality of service |
411
+ | [21:20] | `prot` | Protection mode |
412
+ | [22] | `eom` | End of message |
413
+ | [23] | `eof` | End of frame |
414
+ | [24] | `ex` | Exclusive access |
415
+ | [26:25] | `u` | User bits / error code |
416
+ | [31:27] | `hostid` | Host ID |
417
+
418
+ ### Atomic Operation Types
419
+
420
+ | Type | Value | Description |
421
+ |------|-------|-------------|
422
+ | `UMI_ATOMIC_ADD` | 0x00 | Atomic add |
423
+ | `UMI_ATOMIC_AND` | 0x01 | Atomic AND |
424
+ | `UMI_ATOMIC_OR` | 0x02 | Atomic OR |
425
+ | `UMI_ATOMIC_XOR` | 0x03 | Atomic XOR |
426
+ | `UMI_ATOMIC_MAX` | 0x04 | Atomic signed maximum |
427
+ | `UMI_ATOMIC_MIN` | 0x05 | Atomic signed minimum |
428
+ | `UMI_ATOMIC_MAXU` | 0x06 | Atomic unsigned maximum |
429
+ | `UMI_ATOMIC_MINU` | 0x07 | Atomic unsigned minimum |
430
+ | `UMI_ATOMIC_SWAP` | 0x08 | Atomic swap |
431
+
432
+ ### SumiDriver
433
+
434
+ Cocotb bus driver for sending UMI transactions.
435
+
436
+ **Signals:**
437
+ - `valid` - Transaction valid
438
+ - `cmd` - 32-bit command header
439
+ - `dstaddr` - Destination address
440
+ - `srcaddr` - Source address
441
+ - `data` - Data payload
442
+ - `ready` - Backpressure from receiver
443
+
444
+ **Methods:**
445
+ - `append(transaction)` - Queue a transaction for sending
446
+ - `get_bus_width()` - Get data bus width in bits
447
+ - `get_addr_width()` - Get address bus width in bits
448
+
449
+ ### SumiMonitor
450
+
451
+ Cocotb bus monitor for receiving UMI transactions.
452
+
453
+ **Signals:** Same as SumiDriver
454
+
455
+ **Methods:**
456
+ - `add_callback(fn)` - Register callback for received transactions
457
+ - `get_bus_width()` - Get data bus width in bits
458
+ - `get_addr_width()` - Get address bus width in bits
459
+
460
+ ### UmiMemoryDevice
461
+
462
+ Virtual memory model that responds to UMI read/write requests.
463
+
464
+ **Methods:**
465
+ - `read(address, length)` - Direct memory read
466
+ - `write(address, data)` - Direct memory write
467
+ - `dump_memory()` - Get all memory contents
468
+ - `clear()` - Clear memory
469
+
470
+ ## Dependencies
471
+
472
+ - [cocotb](https://www.cocotb.org/) >= 2.0.1
473
+ - [cocotb-bus](https://github.com/cocotb/cocotb-bus) >= 0.3.0
474
+ - [siliconcompiler](https://github.com/siliconcompiler/siliconcompiler) >= 0.35.0
475
+ - Python >= 3.10
476
+
477
+ ## Contributing
478
+
479
+ We welcome contributions! Please see our [GitHub Issues](https://github.com/zeroasiccorp/cocotbext-umi/issues) for tracking requests and bugs.
480
+
481
+ ## License
482
+
483
+ Apache License 2.0 - See [LICENSE](LICENSE) for details.
484
+
485
+ Copyright 2025 Zero ASIC Corporation
@@ -0,0 +1,17 @@
1
+ cocotbext/umi/__init__.py,sha256=PTQMG-bCFTo0qnv16PqePp4oPyrVp56xD3WuvBLZtys,107
2
+ cocotbext/umi/sumi.py,sha256=0KDatbn82cujB-Qyr1KRutiZz9NUoPWMwHwAYFAyrI4,11612
3
+ cocotbext/umi/tumi.py,sha256=R4516DhU8NfkWhJsKCrAVCLSAtLaTJ1FWTLMo7pxyj0,1497
4
+ cocotbext/umi/drivers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ cocotbext/umi/drivers/sumi_driver.py,sha256=huLaRGJsE9DCKJ_gtf8ClPpLlo12jj6W6BEYCFsZbbc,2379
6
+ cocotbext/umi/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ cocotbext/umi/models/umi_memory_device.py,sha256=C2_mCA65CkbTCJ5eaHpiCOyIJt9vKCifbEU8h7IBfIE,4215
8
+ cocotbext/umi/monitors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
+ cocotbext/umi/monitors/sumi_monitor.py,sha256=IFEWq24ZNl4VAvPtY_I3uz1kkOFaQuuRtlLlYDAM3Ac,2182
10
+ cocotbext/umi/utils/bit_utils.py,sha256=dBuMk5KzNeOlRmEOGUXhD_q0inViG5XHZn2DVSNUgVI,2402
11
+ cocotbext/umi/utils/generators.py,sha256=ehRXvm5jbiguS6Qli1YMtyQlKNvKcA75DQ4-qgw0Qgw,816
12
+ cocotbext/umi/utils/vrd_transaction.py,sha256=hNUAwt0df1dbbIV7_c2JEe0P37D4cOEGqQ02uhUzckI,203
13
+ cocotbext_umi-0.0.2.dist-info/licenses/LICENSE,sha256=B5tOloKW6Gl3gEWsoxJemgLKIO4dGHXUuzT4Ti77wGE,11355
14
+ cocotbext_umi-0.0.2.dist-info/METADATA,sha256=ROA9_FK0oz2UXPHZJGpusCaon1c6nDIij_yeNFLah28,22254
15
+ cocotbext_umi-0.0.2.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
16
+ cocotbext_umi-0.0.2.dist-info/top_level.txt,sha256=CEzgDDbvABi5X1TOqXPbyRc2Bsf41BTwKc5T8riPRPM,10
17
+ cocotbext_umi-0.0.2.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.10.2)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+