Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
60342a6
Add shared block infrastructure to the register allocator and static …
pratheesh Oct 21, 2026
cb33194
Fix existing blocks: validation, cycle counts and register use
pratheesh Oct 21, 2026
e12969c
Add SysConfig test harness and block validator runners
pratheesh Oct 21, 2026
7b21a2e
Remove internal references from comments; neutral tool-path defaults …
pratheesh Oct 21, 2026
cef2e67
uart_crc example: read registers the allocator owns, and add firmware…
pratheesh Oct 21, 2026
5f6cb5b
Ignore build_out/ test output and remove trailing whitespace
pratheesh Oct 21, 2026
e545b30
Neutral comments; do not reference scripts and blocks added later
pratheesh Oct 21, 2026
de6f812
Improve validation descriptions and test coverage
pratheesh Oct 21, 2026
6bb6e12
Pin-sharing warnings describe the conflict instead of a check that do…
pratheesh Oct 21, 2026
469fc53
uart_crc firmware test: accept CGT_TI_PRU_PATH as used by imports.mak
pratheesh Oct 21, 2026
7e4cb23
Neutral comment wording in allocator, SPI read and validator runner
pratheesh Oct 21, 2026
8058a62
SPI read: MODE1 and MODE3 LSB SCLK halves match the configured widths
pratheesh Oct 21, 2026
e76b0e8
Example linker files place .udmem and .usmem
pratheesh Oct 21, 2026
660066d
Add device models and simulator integration
pratheesh Oct 21, 2026
2a6331e
Add device-model and simulator-backed regression tests
pratheesh Oct 21, 2026
a258f2f
Remove trailing whitespace in device model and simulator sources
pratheesh Oct 21, 2026
f8563aa
Device models: neutral comments, PRU_SIM_* environment variables, blo…
pratheesh Oct 21, 2026
276891f
Device models: comments name only files in this change
pratheesh Oct 21, 2026
1cadbb6
Device models: state technical reasons in comments
pratheesh Oct 21, 2026
bed4d36
Collect the device catalogue check under pytest; skip simulator arms …
pratheesh Oct 21, 2026
62269a1
Rename the repository device-model packages to pru_device_models so t…
pratheesh Oct 21, 2026
a3f0b7a
Simulator lookup message and test docstrings describe current behaviour
pratheesh Oct 21, 2026
7bde20c
elf_cosim: optional constant-table override and IEP0 mapping for firm…
pratheesh Oct 21, 2026
0c087ba
elf_cosim: apply the constant-table override to the core being run
pratheesh Oct 21, 2026
3af6909
elf_cosim: option to run the IEP at the core clock
pratheesh Oct 21, 2026
a19c375
Static module: report device-binding errors against the module instance
pratheesh Oct 21, 2026
1195076
Title-case Device Model and live-view display names
pratheesh Oct 21, 2026
67d76c0
Test: SPI controller SCLK high and low widths equal the configured wi…
pratheesh Oct 21, 2026
666a9e9
Firmware test fixture linker file places .usmem in PRU_SHAREDMEM
pratheesh Oct 21, 2026
2fd01f9
Add core blocks for data handling, program control, PRU I/O and utils
pratheesh Oct 21, 2026
cda02c1
Add core block tests, fixtures and test harness scripts
pratheesh Oct 21, 2026
c0f9808
Add BSWAP block test matching the allocator's in-place rule
pratheesh Oct 21, 2026
3e20359
Remove unfinished SVPWM negative-test template; remove trailing white…
pratheesh Oct 21, 2026
8902422
Register core blocks in the device-model tables and the validator report
pratheesh Oct 21, 2026
97036e5
Motor-control co-sims: plain technical headers, clpru from CGT_TI_PRU…
pratheesh Oct 21, 2026
14c9896
Core blocks: comments and descriptions name only files in this change…
pratheesh Oct 21, 2026
8f6a433
Core blocks: state technical reasons in block comments; neutral deadb…
pratheesh Oct 21, 2026
eeae7bc
Core block scripts and tests: state technical reasons in comments
pratheesh Oct 21, 2026
750b529
Core block tests: neutral section labels and scratch directory name
pratheesh Oct 21, 2026
89f633e
Core block tests: describe behaviour, not history
pratheesh Oct 21, 2026
e392fcb
Core blocks: neutral comment wording
pratheesh Oct 21, 2026
0397b8a
XFR2SPIN validator: cross-core writer blocks register themselves; ste…
pratheesh Oct 21, 2026
3f49cef
Move the XFR2SPIN SysConfig end-to-end script to the change that adds…
pratheesh Oct 21, 2026
7ad3a46
Core block tests import device models from pru_device_models
pratheesh Oct 21, 2026
2d28b5b
Counted PWM tests map c26 to the IEP themselves and skip when the sim…
pratheesh Oct 21, 2026
9f1fc89
PWM block texts state the simulator conditions their timing was check…
pratheesh Oct 21, 2026
8ffdd55
Core block tests and texts describe current behaviour; simulator hint…
pratheesh Oct 21, 2026
cde0062
Pin-collision baseline: TI's examples have no findings, so ship it em…
pratheesh Oct 21, 2026
2ea748d
Core block metadata: basis fields named for what they hold; tests and…
pratheesh Oct 21, 2026
a714d21
mailbox_block: a consume wider than 4 bytes is a 64-bit-convention ou…
pratheesh Oct 21, 2026
0705ed8
Core block tooltips within 200 characters; detail moved to long descr…
pratheesh Oct 21, 2026
1bd77ef
Group entry test: match the template's CTPPR0 comment regardless of case
pratheesh Oct 21, 2026
04d9571
Title-case block display names to SysConfig's UI convention
pratheesh Oct 21, 2026
498fcb0
Block validator runner reads the instance from --inst-file
pratheesh Nov 6, 2026
84aaee1
Pad sharing check reports unavailable device pin data as unknown
pratheesh Nov 6, 2026
bb61cac
Allocator passes lo/hi registers for outputs above 4 bytes on seconda…
pratheesh Nov 6, 2026
3ea5fee
Allocator holds back R26/R27 when block macros use TEMP_REG3/TEMP_REG4
pratheesh Nov 6, 2026
d8d8134
Merge review fixes from the infrastructure layer
pratheesh Nov 6, 2026
af07099
Make the quadrature model's forward order lead with A and tolerate a …
pratheesh Nov 6, 2026
2d06275
BiSS Line model: restart the per-frame state between frames and carry…
pratheesh Nov 6, 2026
31e1883
Terminate the whole process group when a TI-run command times out on …
pratheesh Nov 6, 2026
2819fa3
Report a missing TI pru-simulator checkout as a refusal in the bound-…
pratheesh Nov 6, 2026
219017b
Headless simulator: read ELF symbols from the symbol table section
pratheesh Nov 6, 2026
41a8a1f
Simulators: ZERO and FILL change exactly the addressed bytes
pratheesh Nov 6, 2026
8a27fcc
Headless simulator: use the IEP register map and control bits of the …
pratheesh Nov 6, 2026
7c14f0c
GUI core: settle the attached bus before the first instruction
pratheesh Nov 6, 2026
19bff5c
In-tool SSI encoder: build frames wider than 31 bits exactly
pratheesh Nov 6, 2026
e1c7aae
Emit the effective companion pins in the device-binding manifest
pratheesh Nov 6, 2026
beda2ba
Merge review fixes from the device-model layer
pratheesh Nov 6, 2026
dbeec95
Reject out-of-range I2C address and 16-bit loop counts
pratheesh Nov 6, 2026
7cea5dd
Drop I/O block options whose macros do not implement them
pratheesh Nov 6, 2026
c506300
Remove the XFR2PSI block from the AM261x palette
pratheesh Nov 6, 2026
1b6e49a
Check allocated registers in the XFR2PSI and XFR2SPIN global validators
pratheesh Nov 6, 2026
c21f0ac
Park/Clarke transform: write the second result to its own output regi…
pratheesh Nov 6, 2026
5aff2d3
Event block: refuse the unimplemented clear-after-wait option
pratheesh Nov 6, 2026
05550be
IEP timer block: honour the compare index, refuse capture, use tempor…
pratheesh Nov 6, 2026
980701a
Scheduler block: reject the unsupported external timer and validate e…
pratheesh Nov 6, 2026
f8d8a7c
Trigger router block: keep the polling delay counter in a temporary r…
pratheesh Nov 6, 2026
917bf0c
Headless runner: refuse an ELF given without assembly instructions
pratheesh Nov 6, 2026
6051e21
Pin collision check: report pin values that are not whole R30/R31 bit…
pratheesh Nov 6, 2026
a29c4e8
Quadrature simulation: align model and phases to firmware direction
pratheesh Nov 6, 2026
807db6d
Merge review fixes from the device-model layer
pratheesh Nov 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ mcusdk_tagfile
__pycache__/
!*boardcfg_*.bin
source/sysconfig/
source/board/pmic/pmic_lld/
source/board/pmic/pmic_lld/
build_out/
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ function getLookUptable(instance)
}

function validate(inst, report) {
// $name is emitted as the CRC lookup-table symbol ("<name> .byte/.ushort/.uint ..." in .initdmem); reject clpru reserved identifiers via the shared helper.
if (typeof system !== "undefined" && system.getScript) {
var reservedNames = system.getScript("/pru_blocks/common/pru_reserved_names.js");
if (reservedNames && typeof reservedNames.validateInstanceName === "function") {
reservedNames.validateInstanceName(inst, report, "This block emits the instance name as the CRC lookup-table symbol in .initdmem.");
}
}
if(inst["input1"].length == 0)
{
report.logWarning("crc is not intialized",inst)
Expand Down Expand Up @@ -153,17 +160,33 @@ function getMacro(pruInstructionMacro, opCode)
}

if (macroName && macroName.trim().startsWith("m_calculate_crc16")) {
// LUT entries are 2 bytes: the byte offset is index*2, which does not
// fit in a .b0 operand, so the scaled offset is added into the base
// and the LBBO offset register is zeroed (LDI TEMP_REG2, 0) first. The
// LDI is required on every model: without it the .b0 offset left in
// TEMP_REG2 is added a second time on top of the scaled base.
macroBody += ` LDI32 TEMP_REG1, ${lutAddress}
LSR TEMP_REG2.b0, ${crcInit}, 8
XOR TEMP_REG2.b0, TEMP_REG2.b0, ${dataByte}
AND TEMP_REG2, TEMP_REG2, 0xFF
LSL TEMP_REG2, TEMP_REG2, 1
ADD TEMP_REG1, TEMP_REG1, TEMP_REG2
LDI TEMP_REG2, 0
LBBO &${crcResult}, TEMP_REG1, TEMP_REG2.b0, 2
LSL TEMP_REG2, ${crcInit}, 8
XOR ${crcResult}, TEMP_REG2.w0, ${crcResult}`;
}
if (macroName && macroName.trim().startsWith("m_calculate_crc32")) {
// LUT entries are 4 bytes: the byte offset is index*4 (up to 1020),
// which does not fit in a .b0 operand, so the scaled offset is added
// into the base and the LBBO offset register is zeroed first.
macroBody += ` LDI32 TEMP_REG1, ${lutAddress}
LSR TEMP_REG2.b0, ${crcInit}, 24
XOR TEMP_REG2.b0, TEMP_REG2.b0, ${dataByte}
AND TEMP_REG2, TEMP_REG2, 0xFF
LSL TEMP_REG2, TEMP_REG2, 2
ADD TEMP_REG1, TEMP_REG1, TEMP_REG2
LDI TEMP_REG2, 0
LBBO &${crcResult}, TEMP_REG1, TEMP_REG2.b0, 4
LSL TEMP_REG2, ${crcInit}, 8
XOR ${crcResult}, TEMP_REG2, ${crcResult}`;
Expand Down Expand Up @@ -302,22 +325,30 @@ Calculates CRC checksums for error detection in data transmission and storage. C
- LDI32 TEMP_REG1, CRC_LUT_address ; Load LUT address
- LSR TEMP_REG2.b0, init, 8 ; Extract high byte
- XOR TEMP_REG2.b0, TEMP_REG2.b0, dataByte ; XOR with data
- AND TEMP_REG2, TEMP_REG2, 0xFF ; Zero-extend the table index
- LSL TEMP_REG2, TEMP_REG2, 1 ; Scale: entries are 2 bytes (index*2)
- ADD TEMP_REG1, TEMP_REG1, TEMP_REG2 ; Base += scaled byte offset
- LDI TEMP_REG2, 0 ; Zero the LBBO offset register
- LBBO &result, TEMP_REG1, TEMP_REG2.b0, 2 ; Lookup
- LSL TEMP_REG2, init, 8 ; Shift init left
- XOR result, TEMP_REG2.w0, result ; XOR with lookup (9 cycles)
- XOR result, TEMP_REG2.w0, result ; XOR with lookup (13 cycles)

**Generated Assembly** (CRC32 example):
- LDI32 TEMP_REG1, CRC_LUT_address ; Load LUT address
- LSR TEMP_REG2.b0, init, 24 ; Extract high byte
- XOR TEMP_REG2.b0, TEMP_REG2.b0, dataByte ; XOR with data
- AND TEMP_REG2, TEMP_REG2, 0xFF ; Zero-extend the table index
- LSL TEMP_REG2, TEMP_REG2, 2 ; Scale: entries are 4 bytes (index*4)
- ADD TEMP_REG1, TEMP_REG1, TEMP_REG2 ; Base += scaled byte offset
- LDI TEMP_REG2, 0 ; Zero the LBBO offset register
- LBBO &result, TEMP_REG1, TEMP_REG2.b0, 4 ; Lookup
- LSL TEMP_REG2, init, 8 ; Shift init left
- XOR result, TEMP_REG2, result ; XOR with lookup (9 cycles)
- XOR result, TEMP_REG2, result ; XOR with lookup (13 cycles)

**Performance**:
- CRC8: 6 PRU cycles per byte
- CRC16: 9 PRU cycles per byte
- CRC32: 9 PRU cycles per byte
- CRC16: 13 PRU cycles per byte
- CRC32: 13 PRU cycles per byte

**Lookup Table**: Automatically generated 256-entry table based on polynomial
- CRC8: 256 bytes (256 × 1 byte)
Expand Down Expand Up @@ -589,14 +620,14 @@ exports = {
{
return 6
}
if(inst["opCode"] == "m_calculate_crc16")
{
return 9
}
if(inst["opCode"] == "m_calculate_crc32")
{
return 9
}
if(inst["opCode"] == "m_calculate_crc16")
{
return 13
}
if(inst["opCode"] == "m_calculate_crc32")
{
return 13
}
}
}
],
Expand Down Expand Up @@ -627,4 +658,4 @@ exports = {
getMacro,
getDataSize,
getLookUptable
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading