Fill in the sizing sheet of a sensor hub with new sensors, a shorter batch and a slower host link, the way lesson S11.10 does.
Hardware context: Small SoCs reviewed before design: a sensor hub and a logger, sized and checked column by column. Size the clocks, buffers, interrupt count and memory of a sensor hub from its sensor streams.
This is the hub of lesson S11.10 with other numbers. Use its rules: a 2-byte tag on each record, a ring holding one batch plus what arrives during the read, and the slowest core clock that keeps the load under its cap.
This worksheet uses named constants. The first three entries show how to record your decisions.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
question | 8 | input of each check |
Full specification
| Sensor | Bus | Sample | Rate |
|---|---|---|---|
| Accelerometer | SPI | 6 bytes | 800 a second |
| Gyroscope | SPI | 6 bytes | 200 a second |
| Magnetometer | I2C | 6 bytes | 50 a second |
| Pressure sensor | I2C | 3 bytes | 10 a second |
| Design input | Value |
|---|---|
| Record tag | 2 bytes with every sample |
| Batch | the host reads one batch every 1000 ms, over a SPI link of 4,000,000 bits a second |
| Watermark | the accelerometer and gyroscope raise one request every 20 samples; the other two, one for each sample |
| Core work | 400 cycles for each sample, plus 60 cycles for each request |
| Core clock | 25 MHz divided by 1, 2, 4, 8 or 16; the load must stay at or under 25 percent |
| SRAM | storage plus 2048 bytes of stack and 1024 of driver data, rounded up to a power of two |
| DMA rule | the host link needs DMA when the core has fewer than 20 cycles for each byte |
| Sensor SPI bus | one sample read takes (1 + 6) bytes at 500,000 bits a second; the accelerometer is always served first |
Round a time or a byte count up, and a percentage or cycles for each byte down. Enter KiB as a number: 16 for 16 KiB. Enter 1 for yes and 0 for no.
| Entry | Your decision |
|---|---|
| RECORD_RATE | Bytes stored each second, tags included. |
| BATCH_BYTES | Bytes in one batch. |
| SAMPLES | Samples taken each second, by all four sensors. |
| HOST_READ_US | Microseconds to send one batch over the host link. |
| ARRIVE_BYTES | Bytes that arrive while the host reads a batch. |
| RING_BYTES | Bytes of the ring buffer. |
| DOUBLE_BYTES | Bytes of a double buffer. |
| SRAM_KIB_RING | KiB of SRAM with the ring. |
| SRAM_KIB_DOUBLE | KiB of SRAM with the double buffer. |
| IRQ_WATERMARK | Requests each second, with the watermark of 20. |
| CORE_DIVIDER | The divider of the slowest core clock that keeps the load at or under 25 percent. |
| LOAD_PCT | The load at that clock, in percent, rounded down. |
| CYCLES_PER_BYTE | Core cycles for each byte of the host link, rounded down. |
| DMA_NEEDED | Does the host link need DMA? 1 for yes, 0 for no. |
| ACC_FIFO_MAX | The most samples the accelerometer FIFO ever holds. |
| IRQ_AT_W | The accelerometer and gyroscope now raise one request for every W samples. The other two sensors still raise one for each sample. How many requests a second in all? |
Examples
Example 1
RECORD RATE- Input
Bytes stored each second, tags included.
- Output
matches = 1
8 × 800 + 8 × 200 + 8 × 50 + 5 × 10.
Example 2
BATCH BYTES- Input
Bytes in one batch.
- Output
matches = 1
One second of records.
Example 3
SAMPLES- Input
Samples taken each second, by all four sensors.
- Output
matches = 1
800 + 200 + 50 + 10. Without watermarks, each is one request.
Constraints and Contract
- Keep the parameter and named constants. Use the numeric codes and units on this page.
- For IRQ_AT_W, enter a constant expression using W. Only this entry changes with the parameter. The supported integer range is 5 through 40, inclusive.
- Replace each unfinished 65535 with your number.
Hints
Hint 1
Add the tag to each sample before multiplying by the rate.
Hint 2
A ring holds one batch plus what arrives during the read; the SRAM is a power of two.
Hint 3
Find the cycles a second, divide by the cap, and pick the slowest divider that is fast enough. Then check the host link.
What the grader checks: Each check compares the full eight-bit answer. Parameter trials change one condition and keep the other decisions fixed.
16 checks on Icarus Verilog · server. Run the examples first, then check the full regression. Full checks use the server judge. Downloads contain your source only; samples require the simulation service. A passing result establishes the tested cases, not a proof for all possible inputs.
See all 2 problems on this path