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

Perf improvements #314

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
c516525
pinmux: changed spi signals to match common names
HU90m Oct 29, 2024
c5d0f42
pinmux: changed pwm signal name
HU90m Oct 30, 2024
96e6d7c
pinmux: explicitly set sizes for combined output selectors
HU90m Oct 31, 2024
bec0c19
pinmux: Added remaining devices to the headers and pmod
HU90m Oct 31, 2024
c2265d4
sonata_system: dedicated spi devices pulled out of pinmux
HU90m Nov 1, 2024
f9f30c6
doc: updated pin mappings diagram to reflect spi changes
HU90m Nov 1, 2024
248a851
pinmux: removed block inputs with no input options.
HU90m Nov 1, 2024
c27d4cd
Pinmapping uart and spi fixup
marnovandermaas Nov 1, 2024
cb76457
top: added the pmodc gpio block and pins
HU90m Nov 1, 2024
e403668
Update SW definitions of number of GPIO/UART/SPI
AlexJones0 Nov 1, 2024
97c6735
Update manual pinmux checker for new pin mapping changes
AlexJones0 Oct 31, 2024
029c903
Update pinmux tests for mapping changes & convert SPI test to use ext…
AlexJones0 Nov 1, 2024
09ba375
Attach Basic PMOD SF3 SPI DPI to PMOD1 in Verilator
AlexJones0 Nov 1, 2024
e523ec8
Add PMODC pins to XDC file
AlexJones0 Nov 1, 2024
a23c6e5
Increase optimisation level
elliotb-lowrisc Oct 31, 2024
dd85088
[rtl] Add register stage to SPI internal loopback
GregAC Nov 3, 2024
c4ff981
[ci] Save bitstream utilization and timing reports as artifacts
GregAC Nov 3, 2024
f0ff867
[rtl] Increase outstanding requests in SRAM wrapper
GregAC Oct 28, 2024
a2b4006
Update lowrisc_ibex to lowrisc/cheriot-ibex@ea2df9db
GregAC Oct 28, 2024
0f366cb
[rtl] Explicitly set RV32B/RV32M for Ibex
GregAC Oct 28, 2024
8235bc7
Switch to single cycle multiplier for Ibex
GregAC Oct 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion rtl/ip/spi/rtl/spi.sv
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,13 @@ module spi import spi_reg_pkg::*; #(
// Internal loopback functionality allowing the input (CIPO) to be received directly from
// the output (COPI) for testing.
logic spi_cipo;
assign spi_cipo = reg2hw.control.int_loopback.q ? spi_copi_o : spi_cipo_i;
logic spi_copi_q;

always_ff @(posedge clk_i) begin
Copy link
Contributor

Choose a reason for hiding this comment

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

I have noticed the lack of reset but think it is fine. The u_spi_core/copi_shift_q driving it also lacks a reset, so this is just replicating the behaviour one cycle later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah I prefer to leave resets off flops that don't strictly need them. Given the SPI ignores incoming data when it's not been specifically command to clock things in/out then it won't ever actually 'see' the first bit out of reset anyway.

spi_copi_q <= spi_copi_o;
end

assign spi_cipo = reg2hw.control.int_loopback.q ? spi_copi_q : spi_cipo_i;

spi_core u_spi_core (
.clk_i,
Expand Down
4 changes: 3 additions & 1 deletion sw/cheri/tests/spi_tests.hh
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,9 @@ int spi_irq_test(SpiPtr spi, ds::xoroshiro::P32R8 &prng, Log &log) {
*/
int spi_loopback_test(SpiPtr spi, bool external, bool cpol, bool cpha, bool msb_first, ds::xoroshiro::P32R8 &prng,
Log &log) {
constexpr uint32_t kSpiSpeed = 0u; // Let's go as fast as possible.
// Register stage in internal loopback means this is the fastest possible
// speed.
constexpr uint32_t kSpiSpeed = 1u;
// Take a copy of the PRNG so that we can predict the read-side data.
ds::xoroshiro::P32R8 read_prng = prng;
size_t bytes_read = 0u;
Expand Down