Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serial Peripheral Interface #148

Draft
wants to merge 33 commits into
base: main
Choose a base branch
from
Draft

Serial Peripheral Interface #148

wants to merge 33 commits into from

Conversation

robtorx
Copy link
Contributor

@robtorx robtorx commented Dec 31, 2024

Description & Motivation

Adding Serial Peripheral Interface to ROHD-HCL. Contains BFM's and hardware gaskets for Main and Sub components in a SPI.
SPI is a commonly used interface and adding "drop in" components for SPI allows for easier use in designs.

Related Issue(s)

N/A

Testing

Testing included BFM unit tests, component unit tests, and BFM/ component cross testing.

Backwards-compatibility

Is this a breaking change that will not be backwards-compatible? If yes, how so?

No.

Documentation

Does the change require any updates to documentation? If so, where? Are they included?

Documentation added to doc/components/. Local API docs generated.

Copy link
Contributor

@mkorbel1 mkorbel1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

Be sure to update the description etc. in the template for the PR

pubspec.yaml Outdated Show resolved Hide resolved
lib/rohd_hcl.dart Outdated Show resolved Hide resolved
lib/src/gaskets/spi/spi_main.dart Outdated Show resolved Hide resolved
lib/src/gaskets/spi/spi_main.dart Show resolved Hide resolved
lib/src/gaskets/spi/spi_sub.dart Show resolved Hide resolved
test/spi/spi_gaskets_test.dart Outdated Show resolved Hide resolved
test/spi/spi_gaskets_test.dart Outdated Show resolved Hide resolved
test/spi/spi_gaskets_test.dart Show resolved Hide resolved
test/spi/spi_gaskets_test.dart Show resolved Hide resolved
test/spi/spi_gaskets_test.dart Show resolved Hide resolved
lib/src/models/spi_bfm/spi_main_driver.dart Outdated Show resolved Hide resolved
lib/src/models/spi_bfm/spi_monitor.dart Outdated Show resolved Hide resolved
lib/src/models/spi_bfm/spi_sub_driver.dart Outdated Show resolved Hide resolved
final count = Counter.simple(
clk: intf.sclk,
enable: ~intf.csb,
reset: reset ?? Const(0, width: 1),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, if there's no reset, then maybe this whole counter shouldn't be here, actually. That would mean the done signal is dependent on a reset being provided.

});

// checking prev value at negedge
intf.sclk.negedge.listen((event) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this check happening on negedge? I think you can just compare previousValue and value on sclk.posedge directly?

// checking prev value at negedge
intf.sclk.negedge.listen((event) {
if (misoVal != null && misoVal != intf.miso.previousValue) {
logger.severe('Data on MISO is changing on posedge of sclk');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a test that causes the checker to fail

@robtorx robtorx requested a review from mkorbel1 January 27, 2025 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants