diff --git a/contributing.md b/contributing.md
index c9646ab24b..4ee3145c21 100644
--- a/contributing.md
+++ b/contributing.md
@@ -249,7 +249,7 @@ contributing to the documentation here are some rough guidelines to follow:
properties. Just use **autoattribute**. **autoproperty** causes errors
on ReadTheDocs.
- * Follow the [google style guide](https://www.sphinx-doc.org/en/1.5/ext/example_google.html) for docstrings this makes the
+ * Follow the [google style guide](https://www.sphinx-doc.org/en/master/usage/extensions/example_google.html) for docstrings this makes the
documentation easier to read while looking at the source code.
* Keep in mind that people will be reading both the generated
@@ -284,7 +284,7 @@ contributing to the documentation here are some rough guidelines to follow:
### Guidelines for Markdown Files
-- keep in mind that markdown files in the `chipwhisperer-target-cw308t`
+- Keep in mind that markdown files in the `chipwhisperer-target-cw308t`
submodule need to also render on [GitHub](https://github.com/newaetech/chipwhisperer-target-cw308t)
@@ -340,7 +340,7 @@ When editing or creating tutorials here are a few things to consider:
use with nbparameterize for running our automated tests so we can figure
it out for you.
- * When writing in markdown cells please use the [pandoc style markdown](https://rmarkdown.rstudio.com/authoring_pandoc_markdown.html)
+ * When writing in markdown cells please use the [pandoc style markdown](https://pandoc.org/MANUAL.html#pandocs-markdown)
* This list contains guidelines and will update over time. We will run the
tutorials through the tutorial build system and fix errors that come up.
diff --git a/docs/source/Capture/20-pin-connector.md b/docs/source/Capture/20-pin-connector.md
index fb5cb1d00d..8f430feaca 100644
--- a/docs/source/Capture/20-pin-connector.md
+++ b/docs/source/Capture/20-pin-connector.md
@@ -46,7 +46,7 @@ O: output from ChipWhisperer capture device / input to target
| 5 | nRST | I/O | Target reset Pin (active low). |
| 6 | HS2 | I/O | High Speed Output (normally clock output). |
| 7 | MISO | I/O | SPI input: MISO (for SPI + AVR Programmer). [^5] |
-| 8 | VREF | I | CW-Lite [^3] and CW-Nano [^4] only; not connected on others. |
+| 8 | VREF | I | CWLite [^3] and CWNano [^4] only; not connected on others. |
| 9 | MOSI | I/O | SPI output: MOSI (for SPI + AVR Programmer). [^5] |
| 10 | TIO1 | I/O | TargetIO Pin 1 - usually UART Rx. |
| 11 | SCK | I/O | SPI output: SCK (for SPI + AVR Programmer). [^5] |
@@ -61,10 +61,10 @@ O: output from ChipWhisperer capture device / input to target
| 20 | +5V (VUSB) | O | \+5V to Target Device [^1] |
-[^1]: Only connected on CW-Pro; not connected on other capture hardware.
+[^1]: Only connected on CWPro; not connected on other capture hardware.
[^2]: 200 mA available; can be turned off via `scope.io.target_pwr` (except on Nano).
-[^3]: See [CW-Lite VTarget Usage](#vtarget-usage) for more information.
-[^4]: On CW-Nano, drive this pin with desired I/O voltage in range 1.5V - 5V.
-[^5]: Unused on CW-Nano.
-[^6]: User output on CW-Nano.
+[^3]: See [CWLite VTarget Usage](#vtarget-usage) for more information.
+[^4]: On CWNano, drive this pin with desired I/O voltage in range 1.5V - 5V.
+[^5]: Unused on CWNano.
+[^6]: User output on CWNano.
diff --git a/docs/source/Capture/ChipWhisperer-Husky.md b/docs/source/Capture/ChipWhisperer-Husky.md
index 5017efeabc..6e664c51b7 100644
--- a/docs/source/Capture/ChipWhisperer-Husky.md
+++ b/docs/source/Capture/ChipWhisperer-Husky.md
@@ -114,7 +114,7 @@ offering vastly improved performance over a typical asynchronous oscilloscope se
| Glitch Width \* | Based on Internal PLL (600-1200MHz), 100% (enable-only) |
| Glitch Width Increments | Based on Internal PLL (600-1200MHz) |
| Glitch Offset | Based on Internal PLL (600-1200MHz) |
-| Glitch Offset Increments | Based on Internal Pll (600-1200MHz) |
+| Glitch Offset Increments | Based on Internal PLL (600-1200MHz) |
| Glitch Cycle Offset | [0, 2^32) | [0, 2^32) | N/A |
| Glitch Cycle Repeat | [0, 8192] | [0, 8192] | N/A |
| Voltage Glitch Type | High-power, low-power crowbar |
diff --git a/docs/source/Capture/ChipWhisperer-Lite.md b/docs/source/Capture/ChipWhisperer-Lite.md
index d308d79d2a..1a442e1013 100644
--- a/docs/source/Capture/ChipWhisperer-Lite.md
+++ b/docs/source/Capture/ChipWhisperer-Lite.md
@@ -1,6 +1,6 @@
# CW1173 ChipWhisperer-Lite
-The ChipWhisperer-Lite represents NewAE Technology Inc.’s most aggressive pursuit of it’s mission to bring side-channel power analysis and glitching attacks to every engineer and student. The FULLY open-source (hardware, software,
+The ChipWhisperer-Lite represents NewAE Technology Inc.'s most aggressive pursuit of it's mission to bring side-channel power analysis and glitching attacks to every engineer and student. The FULLY open-source (hardware, software,
firmware, FPGA code) is launching a revolution in hardware security. In particular, the ChipWhisperer-Lite
serves as a good middle ground between the full feature-set of the ChipWhisperer-Pro, and the affordability of
the ChipWhisperer-Nano.
@@ -15,7 +15,7 @@ analysis.
**NOTE:** This page will only cover the capture side of the board. See
`targets/CW303` for documentation on the target side of the board.
-
+
Available in the [ChipWhisperer-Lite starter kit](../Starter%20Kits/ChipWhisperer-Lite.md), the [Level 1 Starter Kit](../Starter%20Kits/SCAPACK-L1.md), and the [Level 2 Starter Kit](../Starter%20Kits/SCAPACK-L2.md)
@@ -204,7 +204,7 @@ This new serial port has a few advantages:
As well as a few disadvantages:
-* Need to keep track of a serial port (/dev/ttyACMX or COMX) if not using pyserial
+* Need to keep track of a serial port (/dev/ttyACMX or COMX) if not using PySerial
- In addition, old versions of PySerial don't allow us to associate
#### **Mounting Jumpers**
@@ -233,7 +233,7 @@ The following lists jumpers on the ChipWhisperer-Lite Capture Section:
You may wish to break the target section apart from the main capture
board. This can easily be accomplished by following these instructions:
-1. Using a sharp knife (such as Xacto knife or retractable safety knife), cut the traces on the bottom side of the board along the cut line. Pass the knife back and forth several times. Scoring the board deeply will make the breaking process easier and less stressful on the PCB:
+1. Using a sharp knife (such as X-Acto knife or retractable safety knife), cut the traces on the bottom side of the board along the cut line. Pass the knife back and forth several times. Scoring the board deeply will make the breaking process easier and less stressful on the PCB:

diff --git a/docs/source/Capture/ChipWhisperer-Nano.md b/docs/source/Capture/ChipWhisperer-Nano.md
index 1571e05e95..ca087659c9 100644
--- a/docs/source/Capture/ChipWhisperer-Nano.md
+++ b/docs/source/Capture/ChipWhisperer-Nano.md
@@ -252,9 +252,9 @@ the STM32F0 to the input stage.
Similar to the ChipWhisperer-Lite, you can break off the end section. To
do that, you will have to do the following:
-1. Use an xacto knife or similar to deeply score along the perforated
+1. Use an X-Acto knife or similar to deeply score along the perforated
holes on both top and bottom, being very careful not to cut towards
- or near your hand. You will need to hold the CWNANO in an
+ or near your hand. You will need to hold the CWNano in an
appropriate jig or vice.
2. Align the holes on the edge of a hard surface (suggested: block of
wood), and firmly push down on the target end while pushing against
diff --git a/docs/source/Capture/ChipWhisperer-Pro.md b/docs/source/Capture/ChipWhisperer-Pro.md
index e097824ed9..aef0a654c1 100644
--- a/docs/source/Capture/ChipWhisperer-Pro.md
+++ b/docs/source/Capture/ChipWhisperer-Pro.md
@@ -1,7 +1,7 @@
# CW1200 ChipWhisperer-Pro
-The CW1200 (ChipWhisperer Pro) is an upgraded version of the
-ChipWhisperer Lite capture hardware. The Pro includes an FPGA with much
+The CW1200 (ChipWhisperer-Pro) is an upgraded version of the
+ChipWhisperer-Lite capture hardware. The Pro includes an FPGA with much
more space than the Lite, allowing many new features to be added,
including a larger sample buffer, streaming-mode captures, additional
trigger methods, and a touchscreen interface. These features make it a
@@ -143,7 +143,7 @@ by NewAE.
---
### Power Supply
-The ChipWhisperer Pro can be powered either via the USB port,
+The ChipWhisperer-Pro can be powered either via the USB port,
or via the 5V jack. If both are plugged in, the 5V jack will be used
exclusively for power. This configuration (5V jack for power,
USB for comms) is preferred. This is because of the high current draw
@@ -239,7 +239,7 @@ See {doc}`../firmware` for more information on erasing and re-programming ChipWh
### **Streaming Mode**
-The ChipWhisperer Pro has a streaming mode that allows extremely long
+The ChipWhisperer-Pro has a streaming mode that allows extremely long
captures as long as relatively low sampling rates are used. For example,
this plot shows an excerpt from two traces with nearly 1 million samples:
@@ -301,7 +301,6 @@ looks directly at the power trace and does not use these trigger inputs.
The edge/level detector can trigger on four different events:
- Trigger input is low (0)
-
- Trigger input is high (1)
- Trigger input had a rising edge (0 -\> 1)
- Trigger input had a falling edge (1 -\> 0)
@@ -322,7 +321,6 @@ this decoder are:
- **Decode Type**: Which type of traffic is being captured in the
trigger signal? Might be USART or SPI data.
-
- **Trigger Data**: Which data are we searching for? This setting
should be a list of bytes to be detected in order. For example,
`['r', '0']` would detect the string "r0", and `[0x07]` would detect
@@ -364,7 +362,6 @@ The settings for the SAD module are:
128.
- **Set SAD Reference from Current Trace**: Sets the fixed 128 samples
to the current selection.
-
- **SAD Reference vs. Cursor**: Shows the current output of the SAD
calculation. Useful for setting the threshold - it's easy to capture
a number of traces and check what typical values are for this SAD
@@ -418,16 +415,13 @@ with the frequency counter.
**TODO: picture**
- **CLKGEN**: Current frequency of CLKGEN clock in kHz
-
- **Source**: Input to CLKGEN DCM. Could be system clock or EXTCLK
-
- **DCM**: Lock status of CLKGEN DCM
- **Reset DCM**: Reset the CLKGEN output. Useful if clock has
locked at the wrong frequency
- **ADC Clock**: Current ADC sampling rate in kHz
- **Source**: Input to ADC DCM. Could be related to CLKGEN or
EXTCLK
-
- **DCM**: Lock status of ADC DCM
- **Reset DCM**: Reset the ADC clock output
- **Frequency Counter**: Current frequency measured by the frequency
@@ -445,7 +439,6 @@ The routing screen shows the status of the various I/O pins.
- **Aux Output**: Status of the aux SMA connections. Could be used as
trigger input/output, glitch output, and/or clock output
-
- **IO Pins**: Status of each of the IO pins on the 20 pin connector.
Possible values depend on pin
- **Target Power State**: Status of the 3.3 V output. Can be toggled
@@ -464,28 +457,19 @@ the ADC capture settings.
- **Trigger Pins**: Whether each trigger input is enabled. Active
inputs are highlighted
-
- **Mode**: Trigger combination method. Could be AND, OR, or NAND
-
-
- **Trigger Source**: The trigger type in use. Active trigger module
is highlighted
-
- **State**: The current output level of the trigger module
-
-
- **Trigger Mode**: The ADC trigger type. Active mode is highlighted
-
- **Samples**:
- **Delay**: Current ADC offset. This is the number of samples to
wait after trigger before recording begins
-
- **Pre**: Number of pre-trigger samples to be saved
- **Time**: Delay, but converted into a time
- **Total**: Number of samples to be recorded in total
- **ADC gain**:
- **Mode**: Amplification type. Either low or high
-
- **Setting**: Low noise amplifier gain level
---
@@ -498,15 +482,10 @@ The glitch screen shows the current settings for the glitch module.
- **Clock Src**: Input to the glitch module's clock. Active clock is
highlighted
-
- **DCM**: Lock status of the glitch module's DCM
-
-
- **Glitch Setup**:
-
- **Width**: Duty cycle of glitch pulse, as a fraction of one
period
-
- **Fine**: Adjustment on width
- **Offset**: Distance between clock rising edge and glitch pulse
rising edge, as a fraction of one period
@@ -518,14 +497,12 @@ The glitch screen shows the current settings for the glitch module.
- **Trigger Setup**:
- **Trigger**: Cause a manual trigger. Has no effect unless
trigger source is set to Manual
-
- **Offset**: Number of cycles to wait before starting glitch
pulses
- **Repeat**: Number of consecutive pulses to generate
- **Output Status**
- **VCC**: Status of glitching MOSFETs. Shows warning sign if VCC
glitching is enabled
-
- **Cnt**: Total number of glitch pulses generated
## Errata
diff --git a/docs/source/Capture/overview.md b/docs/source/Capture/overview.md
index e611f0bb41..1e68a3d5f2 100644
--- a/docs/source/Capture/overview.md
+++ b/docs/source/Capture/overview.md
@@ -80,7 +80,7 @@ All differences between Husky and Husky Plus are summarized
| Glitch Width | **Based on Internal PLL (600-1200MHz)**, 100% (enable-only) | 0-49.8% of a clock cycle, 100% (enable-only) | 0-49.8% of a clock cycle, 100% | Time increments between [0, 2^32) |
| Glitch Width Increments | **Based on Internal PLL (600-1200MHz)** | 0.4% of a clock cycle | 0.4% of a clock cycle | ~8.3ns |
| Glitch Offset | **Based on Internal PLL (600-1200MHz)** | 0-49.8% of a clock cycle, 100% (enable-only) | 0-49.8% of a clock cycle, 100% | Time increments between [0, 2^32), high jitter |
-| Glitch Offset Increments | **Based on Internal Pll (600-1200MHz)** | 0.4% of a clock cycle | 0.4% of a clock cycle | ~8.3ns, high jitter |
+| Glitch Offset Increments | **Based on Internal PLL (600-1200MHz)** | 0.4% of a clock cycle | 0.4% of a clock cycle | ~8.3ns, high jitter |
| Glitch Cycle Offset | [0, 2^32) | [0, 2^32) | [0, 2^32) | N/A |
| Glitch Cycle Repeat | [0, 8192] | [0, 8192] | [0, 8192] | N/A |
| Voltage Glitch Type | High-power, low-power crowbar | High-power, low-power crowbar | High-power, low-power crowbar | Low-power crowbar |
diff --git a/docs/source/ChipSHOUTER/ChipSHOUTER.md b/docs/source/ChipSHOUTER/ChipSHOUTER.md
index 0f6f97f42d..75781e555a 100644
--- a/docs/source/ChipSHOUTER/ChipSHOUTER.md
+++ b/docs/source/ChipSHOUTER/ChipSHOUTER.md
@@ -1,6 +1,6 @@
# CW520 ChipSHOUTER
-The CW520 (ChipSHOUTER) is a fully-featured Electromagnetic Fault Injection platform that can be used to discover and characterize vulnerabilities in embedded systems. ChipSHOUTER makes EMFI available to test labs, engineering development firms, educators, and embedded enthusiasts. With a flexible API and bundled practice targets the system is a platform for experimentation and education right out of the box. Paired with an X-Y table and some basic python scripting the ChipSHOUTER becomes a fully automatable EMFI platform capable of precision testing and fault characterization.
+The CW520 (ChipSHOUTER) is a fully-featured Electromagnetic Fault Injection platform that can be used to discover and characterize vulnerabilities in embedded systems. ChipSHOUTER makes EMFI available to test labs, engineering development firms, educators, and embedded enthusiasts. With a flexible API and bundled practice targets the system is a platform for experimentation and education right out of the box. Paired with an X-Y table and some basic python scripting the ChipSHOUTER becomes a fully automatable EMFI platform capable of precision testing and fault characterization.

@@ -14,7 +14,7 @@ https://chipshouter.readthedocs.io/en/latest/
The ChipSHOUTER generates large voltages and electromagnetic fields that can be hazardous to human health and
can cause nearby devices to malfunction. Carefully read the safety sections in the ChipSHOUTER manual, available
-on the [ChipSHOUTER github](https://github.com/newaetech/ChipSHOUTER/raw/master/documentation/ChipSHOUTER%20User%20Manual.pdf) before use.
+on the [ChipSHOUTER GitHub](https://github.com/newaetech/ChipSHOUTER/raw/master/documentation/ChipSHOUTER%20User%20Manual.pdf) before use.
## Product Highlights
@@ -36,7 +36,7 @@ with triggering mechanisms, such as oscilloscopes or the ChipWhisperer platform
|---------|--------------|
| Serial command interface | 3.3V CMOS Serial, 115200, 8N1 |
| Protocol | ASCII command prompt, Binary |
-| Serial connection | RJ12 connector with GND, TX/RX, 3.3V output and switchable pulse/arm pin. |
+| Serial connection | RJ12 connector with GND, TX/RX, 3.3V output and switchable pulse/arm pin |
| Hardware trigger connector type | SMB connector, center positive |
| Hardware trigger threshold | 2V |
| Hardware trigger absolute maximum ratings | -0.5V to 6.5V |
diff --git a/docs/source/Serial Ports.md b/docs/source/Serial Ports.md
index 89494dbebf..365d8d731e 100644
--- a/docs/source/Serial Ports.md
+++ b/docs/source/Serial Ports.md
@@ -19,7 +19,7 @@ This new serial port has a few advantages:
As well as a few disadvantages:
-* Need to keep track of a serial port (`/dev/ttyACM*` or `COMX`) if not using pyserial
+* Need to keep track of a serial port (`/dev/ttyACM*` or `COMX`) if not using PySerial
- Old versions of PySerial don't allow us to figure out the correct
serial port from the custom USB interface, meaning the serial port must also be input manually.
* USART settings can be changed by the serial client, which will mess up your communication
diff --git a/docs/source/Starter Kits/ChipWhisperer-Husky.md b/docs/source/Starter Kits/ChipWhisperer-Husky.md
index 20a2b21460..759d5a617b 100644
--- a/docs/source/Starter Kits/ChipWhisperer-Husky.md
+++ b/docs/source/Starter Kits/ChipWhisperer-Husky.md
@@ -27,6 +27,6 @@ also comes with multiple targets (a CW312T-ICE40 and a CW312T-SAM4S).
* 12" SMA-SMA cable x2
* 6" BNC-MCX cable x1
* 6" SMA-MCX cable x1
-* USB-c cable
-* USBC-A adapter
+* USB-C cable
+* USB-A adapter
* [CW308 to CW312 adapter/breakout board](../Targets/CW308_CW312_adapter) x3
diff --git a/docs/source/Starter Kits/ChipWhisperer-Lite.md b/docs/source/Starter Kits/ChipWhisperer-Lite.md
index f4c9f59e8f..196f6e06e5 100644
--- a/docs/source/Starter Kits/ChipWhisperer-Lite.md
+++ b/docs/source/Starter Kits/ChipWhisperer-Lite.md
@@ -1,6 +1,6 @@
# ChipWhisperer-Lite
-The ChipWhisperer-Lite represents NewAE Technology Inc.’s most aggressive pursuit of it’s mission to bring side-channel power analysis and glitching attacks to every engineer and student. The FULLY open-source (hardware, software,
+The ChipWhisperer-Lite represents NewAE Technology Inc.'s most aggressive pursuit of it's mission to bring side-channel power analysis and glitching attacks to every engineer and student. The FULLY open-source (hardware, software,
firmware, FPGA code) is launching a revolution in hardware security. In particular, the ChipWhisperer-Lite
serves as a good middle ground between the full feature-set of the ChipWhisperer-Pro, and the affordability of
the ChipWhisperer-Nano.
@@ -17,17 +17,17 @@ The ChipWhisperer-Lite has a few available hardware options:
| ChipWhisperer-Lite Version | Target | Single Board | Also comes with | Purchase Link |
|---------------------------|-------------|----------|----|----|
-| ChipWhisperer-Lite 1-Part | CW303 XMEGA | Yes | micro-usb cable | [Mouser](https://www.mouser.com/ProductDetail/NewAE/NAE-CW1173?qs=r5DSvlrkXmKKNcTDix800Q%3D%3D) |
-| ChipWhisperer-Lite 32-bit 1-Part | CW303 Arm | Yes | micro-usb cable | [Mouser](https://www.mouser.com/ProductDetail/NewAE/NAE-CWLITE-ARM?qs=r5DSvlrkXmIUEZprO%2Fombw%3D%3D) |
-| ChipWhisperer-Lite 2-Part | CW303 XMEGA | No | micro-usb cable, 20-pin cable, SMA cables | [Mouser](https://www.mouser.com/ProductDetail/NewAE/NAE-CW1173-2PART?qs=r5DSvlrkXmI%2FI%2FEYu37YCg%3D%3D) |
-| ChipWhisperer-Lite Standalone | None | No | micro-usb cable, 20-pin cable, SMA cables | [Mouser](https://www.mouser.com/ProductDetail/NewAE/NAE-CWLITE-CAPTURE?qs=r5DSvlrkXmKUDG90PYjKIA%3D%3D) |
+| ChipWhisperer-Lite 1-Part | CW303 XMEGA | Yes | Micro-USB cable | [Mouser](https://www.mouser.com/ProductDetail/NewAE/NAE-CW1173?qs=r5DSvlrkXmKKNcTDix800Q%3D%3D) |
+| ChipWhisperer-Lite 32-bit 1-Part | CW303 Arm | Yes | Micro-USB cable | [Mouser](https://www.mouser.com/ProductDetail/NewAE/NAE-CWLITE-ARM?qs=r5DSvlrkXmIUEZprO%2Fombw%3D%3D) |
+| ChipWhisperer-Lite 2-Part | CW303 XMEGA | No | Micro-USB cable, 20-pin cable, SMA cables | [Mouser](https://www.mouser.com/ProductDetail/NewAE/NAE-CW1173-2PART?qs=r5DSvlrkXmI%2FI%2FEYu37YCg%3D%3D) |
+| ChipWhisperer-Lite Standalone | None | No | Micro-USB cable, 20-pin cable, SMA cables | [Mouser](https://www.mouser.com/ProductDetail/NewAE/NAE-CWLITE-CAPTURE?qs=r5DSvlrkXmKUDG90PYjKIA%3D%3D) |
## Turning a 1-Part into a 2-Part
Want to attack other targets with your 1-part board? Simply break the
target portion of the board off as described on the ChipWhisperer-Lite capture page,
solder a 20-pin connector on your capture board, and solder SMA connectors onto the
-capture board's
+capture board's.
## Hardware List
diff --git a/docs/source/Starter Kits/ChipWhisperer-Pro.md b/docs/source/Starter Kits/ChipWhisperer-Pro.md
index ca5187df1d..9b0211b521 100644
--- a/docs/source/Starter Kits/ChipWhisperer-Pro.md
+++ b/docs/source/Starter Kits/ChipWhisperer-Pro.md
@@ -1,7 +1,7 @@
# CW1200 ChipWhisperer-Pro Level 3 Starter Kit
-The CW1200 (ChipWhisperer Pro) is an upgraded version of the
-ChipWhisperer Lite capture hardware. The Pro includes an FPGA with much
+The CW1200 (ChipWhisperer-Pro) is an upgraded version of the
+ChipWhisperer-Lite capture hardware. The Pro includes an FPGA with much
more space than the Lite, allowing many new features to be added,
including a larger sample buffer, streaming-mode captures, additional
trigger methods, and a touchscreen interface. These features make it a
diff --git a/docs/source/Starter Kits/index.md b/docs/source/Starter Kits/index.md
index b4b3b6b66d..fc45a3fef5 100644
--- a/docs/source/Starter Kits/index.md
+++ b/docs/source/Starter Kits/index.md
@@ -21,10 +21,10 @@ The starter kits also come with the following hardware/tools:
| Starter Kit | Additional Hardware |
|----------------|--------------|
-| ChipWhisperer-Nano | micro-usb cable
-| ChipWhisperer-Lite | micro-usb cable, 20-pin connector and coax cables (2-part only) |
-| SCAPACK-L1 | micro-usb cable, CW308T Generic PCB, CW308T-STM32F blank PCB, 2x Lifter tool to remove targets, SMA Tee adapter, SMA Cables, SMA to BNC Cable |
-| SCAPACK-L2 | micro-usb cable, CW308T Generic PCB, CW308T-STM32F blank PCB, 2x Lifter tool to remove targets, SMA Tee adapter, SMA Cables, SMA to BNC Cable, H-Field Probe, Differential Probe, Probe power supply (DC-DC), 5V wall adapter for probe/CW308 power |
+| ChipWhisperer-Nano | Micro-USB cable
+| ChipWhisperer-Lite | Micro-USB cable, 20-pin connector and coax cables (2-part only) |
+| SCAPACK-L1 | Micro-USB cable, CW308T Generic PCB, CW308T-STM32F blank PCB, 2x Lifter tool to remove targets, SMA Tee adapter, SMA Cables, SMA to BNC Cable |
+| SCAPACK-L2 | Micro-USB cable, CW308T Generic PCB, CW308T-STM32F blank PCB, 2x Lifter tool to remove targets, SMA Tee adapter, SMA Cables, SMA to BNC Cable, H-Field Probe, Differential Probe, Probe power supply (DC-DC), 5V wall adapter for probe/CW308 power |
| ChipWhisperer-Pro | USB A to B cable, CW506 advanced breakout (level shifter), H-Field Probe, Low Noise Amplifier, Differential Probe, Probe Power Supply (Isolated), 20MHz low-pass filter, SMA to BNC cable, SMA to SMA cable, CW308T Generic PCB, CW308T-STM32F Blank PCB, SMA adapters, 5V power supply |
The ChipSHOUTER starter kit comes with the ChipSHOUTER, as well as 2 EMFI targets and a bunch of
diff --git a/docs/source/Targets/CW303 Arm.md b/docs/source/Targets/CW303 Arm.md
index 91c9d97f8d..176dce6537 100644
--- a/docs/source/Targets/CW303 Arm.md
+++ b/docs/source/Targets/CW303 Arm.md
@@ -1,7 +1,7 @@
# CW303 Arm Target
The ChipWhisperer-Lite board has a break-away target board section. This
-target can be used attached to the CW-Lite or separated and connected
+target can be used attached to the CWLite or separated and connected
via ribbon cable. The breakaway target board has a slightly different
feature set than the CW308T-STM32F3 target board. For more info,
see the CW308T-STM32F documentation.
@@ -38,10 +38,10 @@ connections are as follows:
### Building Firmware
-Building Firmware for this target requires make and arm-none-eabi-gcc.
+Building Firmware for this target requires `make` and `arm-none-eabi-gcc`.
Installation of both these are covered in the {doc}`installation instructions <../installation>`.
-If you have make and arm-none-eabi-gcc, you can build firmware by navigating via command line to the relevant
+If you have `make` and `arm-none-eabi-gcc`, you can build firmware by navigating via command line to the relevant
build directory and running:
```bash
diff --git a/docs/source/Targets/CW303 XMEGA.md b/docs/source/Targets/CW303 XMEGA.md
index 1bbce8dd31..612241aba6 100644
--- a/docs/source/Targets/CW303 XMEGA.md
+++ b/docs/source/Targets/CW303 XMEGA.md
@@ -1,7 +1,7 @@
# CW303 XMEGA Target
The ChipWhisperer-Lite board has a break-away target board section. This
-target can be used attached to the CW-Lite or separated and connected
+target can be used attached to the CWLite or separated and connected
via ribbon cable. The breakaway target board has a slightly different
feature set than the CW308T-XMEGA target board.
@@ -37,10 +37,10 @@ connections are as follows:
### Building Firmware
-Building firmware for this target requires make and avr-gcc.
+Building firmware for this target requires `make` and `avr-gcc`.
Installation of both these are covered in the {doc}`installation instructions <../installation>`.
-If you have make and avr-gcc, you can build firmware by navigating via command line to the relevant
+If you have `make` and `avr-gcc`, you can build firmware by navigating via command line to the relevant
build directory and running:
```bash
diff --git a/docs/source/Targets/CW304 Notduino Target.md b/docs/source/Targets/CW304 Notduino Target.md
index 56a5b300a5..5e98d10d13 100644
--- a/docs/source/Targets/CW304 Notduino Target.md
+++ b/docs/source/Targets/CW304 Notduino Target.md
@@ -1,7 +1,7 @@
# CW304 Notduino Target
The Notduino is used as a target for the ChipWhisperer Capture system.
-This includes interfacing to the CW-Lite (CW1173) and related platforms.
+This includes interfacing to the CWLite (CW1173) and related platforms.

@@ -105,7 +105,7 @@ and C9 if not using the ChipWhisperer for a clock source.
| Silkscreen | ATMega328P | Arduino Name | Notes |
| ---------- | ---------- | ------------ | ------------------------------------------------ |
| GND | Ground | | |
-| 3V3 | VCC | | If NOT connected to CW-Lite, can power from 3-5V |
+| 3V3 | VCC | | If NOT connected to CWLite, can power from 3-5V |
| TXD | PORTD.1 | Pin 1 | Output from AVR |
| RXD | PORTD.0 | Pin 0 | Input to AVR |
| RST | Reset | | |
diff --git a/docs/source/Targets/Target Defines.md b/docs/source/Targets/Target Defines.md
index b6e9784ec5..2de2b93b67 100644
--- a/docs/source/Targets/Target Defines.md
+++ b/docs/source/Targets/Target Defines.md
@@ -10,17 +10,17 @@ firmware build system (e.g. `make PLATFORM=CWLITEXMEGA`).
| MOST COMMON TARGETS |
+=======================================================+
+-------------------------------------------------------+
-| CWLITEARM | CW-Lite Arm (Alias for CW308_STM32F3) |
+| CWLITEARM | CWLite Arm (Alias for CW308_STM32F3) |
+-------------------------------------------------------+
-| CWNANO | CW-Lite Nano (STM32F0_NANO) |
+| CWNANO | CWLite Nano (STM32F0_NANO) |
+-------------------------------------------------------+
-| CWHUSKY | CW-Husky (Alias for CW308_SAM4S) |
+| CWHUSKY | CWHusky (Alias for CW308_SAM4S) |
+-------------------------------------------------------+
+=======================================================+
| AVR/XMEGA Targets (8-Bit RISC) |
+=======================================================+
+-------------------------------------------------------+
-| CWLITEXMEGA | CW-Lite XMEGA (Alias for CW303) |
+| CWLITEXMEGA | CWLite XMEGA (Alias for CW303) |
+-------------------------------------------------------+
| CW301_AVR | Multi-Target Board, AVR Target |
+-------------------------------------------------------+
@@ -36,11 +36,11 @@ firmware build system (e.g. `make PLATFORM=CWLITEXMEGA`).
+ ARM Cortex-M Targets (Generic) |
+=======================================================+
+-------------------------------------------------------+
-| CWLITEARM | CW-Lite Arm (Alias for CW308_STM32F3) |
+| CWLITEARM | CWLite Arm (Alias for CW308_STM32F3) |
+-------------------------------------------------------+
-| CWNANO | CW-Lite Nano (STM32F0_NANO) |
+| CWNANO | CWLite Nano (STM32F0_NANO) |
+-------------------------------------------------------+
-| CWHUSKY | CW-Husky (Alias for CW308_SAM4S) |
+| CWHUSKY | CWHusky (Alias for CW308_SAM4S) |
+-------------------------------------------------------+
| CW308_STM32F0 | CW308T-STM32F0 (ST Micro STM32F0) |
+-------------------------------------------------------+
@@ -61,7 +61,7 @@ firmware build system (e.g. `make PLATFORM=CWLITEXMEGA`).
| CW308_ | CW308T-EFM32GG11 |
| EFM32GG11 | (Silicon Labs Giant Gecko) |
+-------------------------------------------------------+
-| CW308_ | CW-Lite EFM32TG11B |
+| CW308_ | CWLite EFM32TG11B |
| EFM32TG11B | (Silicon Labs Tiny Geko) |
+-------------------------------------------------------+
| CW308_ | CW308T-EFR32MG21 (A version without |
@@ -82,7 +82,7 @@ firmware build system (e.g. `make PLATFORM=CWLITEXMEGA`).
+-------------------------------------------------------+
| CW308_SAM4L | CW308T-SAM4L (Atmel SAM4L) |
+-------------------------------------------------------+
-| CW308_SAML11 | CW-Lite SAML11 (Atmel SAML11) |
+| CW308_SAML11 | CWLite SAML11 (Atmel SAML11) |
+-------------------------------------------------------+
| CW308_STM32F2 | CW308T-STM32F2HWC (ST Micro STM32F215)|
+-------------------------------------------------------+
@@ -98,7 +98,7 @@ firmware build system (e.g. `make PLATFORM=CWLITEXMEGA`).
+ Other 32-bit Architecture |
+=======================================================+
+-------------------------------------------------------+
-| CW308_AURIX | CW-Lite AURIX (Infineon TC233A) |
+| CW308_AURIX | CWLite AURIX (Infineon TC233A) |
+-------------------------------------------------------+
| CW308_FE310 | CW308T-FE310-G002 (RISC-V) |
+-------------------------------------------------------+
diff --git a/docs/source/Tools/CW506 Advanced Breakout Board.md b/docs/source/Tools/CW506 Advanced Breakout Board.md
index b3fe5ebe39..2f4476ea9f 100644
--- a/docs/source/Tools/CW506 Advanced Breakout Board.md
+++ b/docs/source/Tools/CW506 Advanced Breakout Board.md
@@ -156,7 +156,7 @@ point TP9 (the large red test point).
## XMEGA Programming & Voltage Levels
-If you want to program an XMEGA target with the CW506 and CW-Lite,
+If you want to program an XMEGA target with the CW506 and CWLite,
you'll have to place a resistor on your UFO Board. You must connect a
330 Ohm resistor between the GPIO3 and PDIC pin (you can use jumper
cables instead of soldering or physically modifying your board).
diff --git a/docs/source/colophon.md b/docs/source/colophon.md
index 5549752863..0f2e003530 100644
--- a/docs/source/colophon.md
+++ b/docs/source/colophon.md
@@ -103,11 +103,11 @@ the proper clean way to do it:
### Formatting
-* markdown blockquoted headings `>#` (which rendered well on our
+* Markdown blockquoted headings `>#` (which rendered well on our
https://rtfm.newae.com site) do not render nicely here and prevent that
section from being included in the table of contents; omit the
blockquote
-* in "pure" Sphinx, extra whitespace at the start of a line renders well
+* In "pure" Sphinx, extra whitespace at the start of a line renders well
(there was lots of this in pre-Jupyter Book versions of this site), but
with Jupyter Book this creates an ugly box
@@ -129,18 +129,18 @@ the proper clean way to do it:
### Miscellaneous
-* if a markdown source file does not begin with a top-level header, its
+* If a Markdown source file does not begin with a top-level header, its
table of contents entry will be incorrect
-* `
` tags in markdown aren't supported by default and are
+* `
` tags in Markdown aren't supported by default and are
[not recommended](https://jupyterbook.org/en/stable/content/figures.html#raw-html-images)
- * note that in our case, `
` was used for things like sizing
+ * Note that in our case, `
` was used for things like sizing
images, which Jupyter Book does a pretty good job of by default
-* GitHub-style markdown admonitions (e.g. `!!! warning`) are not supported; use
+* GitHub-style Markdown admonitions (e.g. `!!! warning`) are not supported; use
```` ```{warning} ```` instead.
* if using github submodules (as we are here), be aware that **all** `.md` and
`.rst` files in that submodule will get built, even if not explicitly
included in your `_toc.yml`, and will show up in your search results (this
- happened here with markdown files in a submodule's `.github` folder); to
+ happened here with Markdown files in a submodule's `.github` folder); to
avoid this, use `only_build_toc_files` and `exclude_patterns` in your
`_config.yml` file
diff --git a/docs/source/custom-firmware.rst b/docs/source/custom-firmware.rst
index f7962b1f56..20afd36729 100644
--- a/docs/source/custom-firmware.rst
+++ b/docs/source/custom-firmware.rst
@@ -9,15 +9,15 @@ Basic Overview
**************
ChipWhisperer firmware projects can be broken down into four separate parts: the main project files,
-the hardware abstraction layer (HAL), crypto files, and simpleserial.
+the hardware abstraction layer (HAL), crypto files, and SimpleSerial.
Main Project Files
==================
These files are contained in different project folders and are unique to each project. This includes source files and the project
-makefile. For example, simpleserial-aes has :code:`simpleserial-aes.c` which contains :code:`main()` and various other
-functions for reading a key/plaintext over serial, doing an encryption, etc. The makefile for this project tells the build
-which custom files to use, as well as includes the simpleserial makefile and the main build makefile :code:`Makefile.inc`.
+Makefile. For example, simpleserial-aes has :code:`simpleserial-aes.c` which contains :code:`main()` and various other
+functions for reading a key/plaintext over serial, doing an encryption, etc. The Makefile for this project tells the build
+which custom files to use, as well as includes the SimpleSerial Makefile and the main build Makefile :code:`Makefile.inc`.
HAL
===
@@ -26,7 +26,7 @@ The HAL part of the build system is contained in the HAL folder and includes fil
For example, the STM32F3, XMEGA, and SAM4S targets all have their own folder in the HAL folder and include sourcefiles
for implementing things like serial communication, clock setup, etc, as well as interface functions to allow
the main project files to do setup and send and receive serial characters.
-They also include a makefile which specifies which compiler to use, as well as compile and build flags.
+They also include a Makefile which specifies which compiler to use, as well as compile and build flags.
Finally, they will typically have a linker script file, which defines the various memory regions for flash, RAM, etc.
Crypto
@@ -39,7 +39,7 @@ algorithms in the same project.
SimpleSerial
============
-The simpleserial folder contains the implementation of the target side of the simpleserial protocol. If you want to modify
+The simpleserial folder contains the implementation of the target side of the SimpleSerial protocol. If you want to modify
anything related to that, this is the spot to do it in.
********
@@ -120,9 +120,9 @@ plaintext and send it back. Our project files typically support both simpleseria
Note that the above doesn't use the crypto portion of the build system. Unless you want to use your algorithm
across multiple projects, typically it's easier to just include your algorithm in the main project files.
-The final thing we need to do is setup our makefile. Your makefile just needs to
+The final thing we need to do is setup our Makefile. Your Makefile just needs to
include the build filename that you want, the source files, and include the simpleserial and main
-makefiles:
+Makefiles:
.. code:: Makefile
diff --git a/docs/source/debugging.rst b/docs/source/debugging.rst
index 7ac8e049ad..3edf882858 100644
--- a/docs/source/debugging.rst
+++ b/docs/source/debugging.rst
@@ -109,7 +109,7 @@ included in the main ChipWhisperer repository at :code:`chipwhisperer/cw_openocd
After this file is used by OpenOCD, additional commands are required to select the correct
ChipWhisperer via its USB VendorID and ProductID, as well as select JTAG or SWD mode. After this,
-you can select your target file. Configuration must be done in this order, or openocd will exit
+you can select your target file. Configuration must be done in this order, or OpenOCD will exit
with an error. The general command line configuration is:
.. code:: bash
@@ -203,15 +203,15 @@ Included OpenOCD Scripts
========================
To make interacting with OpenOCD easier, some scripts are included in ChipWhisperer's `openocd` folder.
-This includes both normal openocd scripts/config files, as well as `run_openocd.sh`, a shell script
-that puts ChipWhisperer into MPSSE mode and can either use openocd to program a target, or
-set openocd up for debugging. Usage can be printed by:
+This includes both normal OpenOCD scripts/config files, as well as `run_openocd.sh`, a shell script
+that puts ChipWhisperer into MPSSE mode and can either use OpenOCD to program a target, or
+set OpenOCD up for debugging. Usage can be printed by:
.. code:: bash
./run_openocd.sh -h
-You can debug by specifying the ChipWhisperer, jtag/swd mode, and the openocd target config file:
+You can debug by specifying the ChipWhisperer, JTAG/SWD mode, and the OpenOCD target config file:
.. code:: bash
diff --git a/docs/source/simpleserial.rst b/docs/source/simpleserial.rst
index 03f41bb181..0520013059 100644
--- a/docs/source/simpleserial.rst
+++ b/docs/source/simpleserial.rst
@@ -9,10 +9,10 @@ a command field.
In general, communication has the following steps:
-1. Host PC sends a packet using ChipWhisperer’s Python API
+1. Host PC sends a packet using ChipWhisperer's Python API
2. Capture device sends this packet over UART
3. Target receives the packet and decodes it
-4. Target utilizes the data in a callback selected by the packet’s
+4. Target utilizes the data in a callback selected by the packet's
command field
5. Target optionally sends data back
6. Target sends back an acknowledgement packet
@@ -143,7 +143,7 @@ Your callback can be registered in both V1 and V2 in ``main()`` by
simpleserial_addcmd(cmd, cmd_len, my_callback);
**By default, V1 does not support variable length commands, so V1 will
-ignore all packets that don’t send** ``cmd_len`` **bytes of data unless
+ignore all packets that don't send** ``cmd_len`` **bytes of data unless
specified as a variable length command.**
To wait for a packet, use ``simpleserial_get()`` after registering your
@@ -154,7 +154,7 @@ commands:
while (1) simpleserial_get();
``simpleserial_get()`` **blocks until a packet is received, so your
-target device won’t be able to do anything between calling**
+target device won't be able to do anything between calling**
``simpleserial_get()`` **and receiving a packet.**
Sending Data in C
@@ -283,7 +283,7 @@ V2 is used it will equal ``SS_VER_2_1``. For example:
return 0x00;
}
-Using SimpleSerial Outside of ChipWhipserer’s HAL
+Using SimpleSerial Outside of ChipWhipserer's HAL
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SimpleSerial can be used in other projects by including
@@ -298,7 +298,7 @@ makefile and defining the following function signatures in a file called
The implementation of these functions is up to you, so long as
``getch()`` blocks.
-Using V2’s Additional Features
+Using V2's Additional Features
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Variable Length Commands
@@ -321,7 +321,7 @@ document). For example:
Sub Commands
^^^^^^^^^^^^
-In addition to the main ``cmd`` field, there’s an additional byte,
+In addition to the main ``cmd`` field, there's an additional byte,
``scmd``, which is passed to your callback function. This field can be
useful for changing behaviour of callbacks. For example, you can use
``scmd`` when transferring large amounts of data to indicate which chunk
@@ -598,7 +598,7 @@ It might return without calling a callback for several reasons:
- There are no handler listening to the command send.
-- The send packet is invalid. e.g. in SimpleSerial this could be due to
+- The send packet is invalid. e.g. in SimpleSerial this could be due to
data bytes not being in HexASCII format.
- The data buffer has an unexpected length.
diff --git a/docs/source/starting.rst b/docs/source/starting.rst
index b3589873cd..d2c344cef6 100644
--- a/docs/source/starting.rst
+++ b/docs/source/starting.rst
@@ -44,9 +44,9 @@ If you've installed natively:
notebooks use bash to run **make** or remove files for building
firmware. This may be changed in the future but for now it is
required. If you installed using the Virtual Machine (VM) the
- terminal is a bash like terminal and you should have no problem.
+ terminal is a bash-like terminal and you should have no problem.
If you installed on linux, same deal. However, if you installed
- on Windows/Mac you may have to install a bash like terminal. If
+ on Windows/Mac you may have to install a bash-like terminal. If
you installed Git to install **chipwhisperer** you already have
**git-bash** available to you. Here are a few bash-like terminals
available on other windows:
diff --git a/docs/source/virtual-box-inst.rst b/docs/source/virtual-box-inst.rst
index d20daf8e18..7b7a64af3d 100644
--- a/docs/source/virtual-box-inst.rst
+++ b/docs/source/virtual-box-inst.rst
@@ -35,9 +35,9 @@ VirtualBox Image
* Verify that the VM boots.
-.. note:: If you are on linux you need to add yourself to the *vboxusers*
+.. note:: If you are on Linux you need to add yourself to the *vboxusers*
permission group using, so Virtual Box is given permission to access
- usb devices::
+ USB devices::
sudo usermod -aG vboxusers
diff --git a/software/chipwhisperer/__init__.py b/software/chipwhisperer/__init__.py
index ad944006af..e538e4b15f 100644
--- a/software/chipwhisperer/__init__.py
+++ b/software/chipwhisperer/__init__.py
@@ -311,16 +311,16 @@ def scope(scope_type : Optional[Type[scopes.ScopeTypes]]=None, name : opstr=None
* :class:`scopes.OpenADC` (Pro and Lite)
* :class:`scopes.CWNano` (Nano)
- If multiple chipwhisperers are connected, the serial number of the one you
+ If multiple ChipWhisperers are connected, the serial number of the one you
want to connect to can be specified by passing sn=
Args:
scope_type: Scope type to connect to. Types
can be found in chipwhisperer.scopes. If None, will try to detect
the type of ChipWhisperer connected. Defaults to None.
- name: model name of the ChipWhisperer that you want to
+ name: Model name of the ChipWhisperer that you want to
connect to. Alternative to specifying the serial number when
- multiple ChipWhisperers, all of different type, are connected.
+ multiple ChipWhisperers, all of different types, are connected.
Defaults to None. Valid values:
* Nano
@@ -333,16 +333,16 @@ def scope(scope_type : Optional[Type[scopes.ScopeTypes]]=None, name : opstr=None
idProduct: idProduct of the ChipWhisperer that you want to
connect to. Alternative to specifying the serial number when
- multiple ChipWhisperers, all of different type, are connected.
+ multiple ChipWhisperers, all of different types, are connected.
Defaults to None. Valid values:
- * 0xace0: CW-Nano
+ * 0xace0: CWNano
- * 0xace2: CW-Lite
+ * 0xace2: CWLite
- * 0xace3: CW-Pro
+ * 0xace3: CWPro
- * 0xace5: CW-Husky
+ * 0xace5: CWHusky
sn: Serial number of ChipWhisperer that you want to
connect to. sn is required if more than one ChipWhisperer of the
@@ -361,10 +361,10 @@ def scope(scope_type : Optional[Type[scopes.ScopeTypes]]=None, name : opstr=None
Connected scope object.
Raises:
- OSError: Can be raised for issues connecting to the chipwhisperer, such
+ OSError: Can be raised for issues connecting to the ChipWhisperer, such
as not having permission to access the USB device or no ChipWhisperer
being connected.
- Warning: Raised if multiple chipwhisperers are connected, but the type
+ Warning: Raised if multiple ChipWhisperers are connected, but the type
and/or the serial numbers are not specified
.. versionchanged:: 5.1
@@ -441,7 +441,7 @@ def capture_trace(scope : scopes.ScopeTypes, target : targets.TargetTypes, plain
Does all individual steps needed to capture a trace (arming the scope
sending the key/plaintext, getting the trace data back, etc.). Uses
- target.output_len as the length of the expected target reponse for
+ target.output_len as the length of the expected target response for
simpleserial.
Args:
@@ -454,7 +454,7 @@ def capture_trace(scope : scopes.ScopeTypes, target : targets.TargetTypes, plain
bytearray. If None, don't send key. Defaults to None.
ack (bool, optional): Check for ack when reading response from target.
Defaults to True.
- poll_done (bool, optional): poll Husky to find out when it's done
+ poll_done (bool, optional): Poll Husky to find out when it's done
capturing, instead of calculating the capture time based on the
capture parameters. Useful for long trigger-based segmented
captures. Can also result in slightly faster captures when the
diff --git a/software/chipwhisperer/analyzer/attacks/_base.py b/software/chipwhisperer/analyzer/attacks/_base.py
index 6861004cd7..2cb67a1d82 100644
--- a/software/chipwhisperer/analyzer/attacks/_base.py
+++ b/software/chipwhisperer/analyzer/attacks/_base.py
@@ -118,7 +118,7 @@ def set_analysis_algorithm(self, analysis_algorithm, leakage_object=None):
analysis_algorithm (AlgorithmsBase): Algorithm used for analyzing
trace data. Only use cpa_algorithms.Progressive for now.
leakage_object (ModelsBase, optional): Model used to get the
- leakage of the target (i.e. the sbox output). Needs to be set
+ leakage of the target (i.e. the S-box output). Needs to be set
before the attack can happen
"""
self.attack = analysis_algorithm()
@@ -163,7 +163,7 @@ def process_traces(self, callback=None):
processTraces = camel_case_deprecated(process_traces)
- # for backwards compatability
+ # for backwards compatibility
def processTracesNoGUI(self, callback=None, show_progress_bar=False):
return self.processTraces(callback, show_progress_bar)
diff --git a/software/chipwhisperer/analyzer/attacks/_stats.py b/software/chipwhisperer/analyzer/attacks/_stats.py
index d1edabe7e2..2c287e0caa 100644
--- a/software/chipwhisperer/analyzer/attacks/_stats.py
+++ b/software/chipwhisperer/analyzer/attacks/_stats.py
@@ -226,7 +226,7 @@ def find_maximums(self, bytelist=None, use_absolute=True, use_single=False):
self.maxes[i][j]['point'] = where
self.maxes[i][j]['value'] = self.diffs[i][self.maxes[i][j]['hyp']][where]
- self.maxes[i][::-1].sort(order='value') # sorts nunpy array in place and in reverse order
+ self.maxes[i][::-1].sort(order='value') # sorts numpy array in place and in reverse order
self.maxValid[i] = True
if self.known_key is not None:
diff --git a/software/chipwhisperer/analyzer/attacks/coefficient_vs_trace_number.py b/software/chipwhisperer/analyzer/attacks/coefficient_vs_trace_number.py
index d16937be3a..0c2c49018c 100644
--- a/software/chipwhisperer/analyzer/attacks/coefficient_vs_trace_number.py
+++ b/software/chipwhisperer/analyzer/attacks/coefficient_vs_trace_number.py
@@ -79,8 +79,8 @@ def get_effecient(self):
for j in range(256):
all_coef[j][0] = maxcpa[j]
- # Update correaltion by coming traces.
- for i in tnrange(1, int(N/interval)):
+ # Update correlation by coming traces.
+ for i in tnrange(1, int(N/self.interval)):
trace_array = all_traces[i * self.interval:(i +1) * self.interval]
maxcpa = [0] * 256
t_bar = self.continue_mean(trace_array, t_bar, i)
diff --git a/software/chipwhisperer/analyzer/attacks/cpa_new.py b/software/chipwhisperer/analyzer/attacks/cpa_new.py
index 8968dad673..b74a4a29b5 100644
--- a/software/chipwhisperer/analyzer/attacks/cpa_new.py
+++ b/software/chipwhisperer/analyzer/attacks/cpa_new.py
@@ -56,7 +56,7 @@ def __init__(self, proj, leak_model, algorithm):
proj (Project): c
leak_model (AESLeakageHelper): Leakage model to use for getting
hamming weight
- algorithm (AlgorithmsBase: Algorithm to use for attack
+ algorithm (AlgorithmsBase): Algorithm to use for attack
"""
super().__init__()
self.set_analysis_algorithm(algorithm, leak_model)
diff --git a/software/chipwhisperer/analyzer/attacks/models/AES128_8bit.py b/software/chipwhisperer/analyzer/attacks/models/AES128_8bit.py
index e81367b595..fe89ef3870 100644
--- a/software/chipwhisperer/analyzer/attacks/models/AES128_8bit.py
+++ b/software/chipwhisperer/analyzer/attacks/models/AES128_8bit.py
@@ -47,19 +47,19 @@ class AESLeakageHelper(object):
INVSHIFT_undo = [0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12, 1, 6, 11]
def sbox(self, data):
- """Helper function: performs AES sbox on single byte"""
+ """Helper function: performs AES S-box on single byte"""
return sbox(data)
def inv_sbox(self, data):
- """Helper function: performs AES inv-sbox on single byte"""
+ """Helper function: performs AES inverse S-box on single byte"""
return inv_sbox(data)
def subbytes(self, state):
- """Helper function: performs AES sbox on all bytes of state"""
+ """Helper function: performs AES S-box on all bytes of state"""
return subbytes(state)
def inv_subbytes(self, state):
- """Helper function: performs AES inv-sbox on all bytes of state"""
+ """Helper function: performs AES inverse S-box on all bytes of state"""
return inv_subbytes(state)
def mixcolumns(self, state):
@@ -67,7 +67,7 @@ def mixcolumns(self, state):
return mixcolumns(state)
def inv_mixcolumns(self, state):
- """Helper function: performs AES inv-mixcols on all bytes of state"""
+ """Helper function: performs AES inverse mixcols on all bytes of state"""
return inv_mixcolumns(state)
def shiftrows(self, state):
@@ -75,7 +75,7 @@ def shiftrows(self, state):
return shiftrows(state)
def inv_shiftrows(self, state):
- """Helper function: performs AES inv-shiftrows on all bytes of state"""
+ """Helper function: performs AES inverse shiftrows on all bytes of state"""
return inv_shiftrows(state)
def key_schedule_rounds(self, inputkey, inputround, desiredround):
@@ -95,7 +95,7 @@ def xtime(self, a):
def leakage(self, pt, ct, key, bnum):
"""
- Override this function with specific leakage function (S-Box output, HD, etc).
+ Override this function with specific leakage function (S-box output, HD, etc).
Args:
pt: 16-byte plain-text input
@@ -198,7 +198,7 @@ def process_known_key(self, inpkey):
return k
class SBoxInOutDiff(AESLeakageHelper):
- name = 'HD: AES SBox Input to Output'
+ name = 'HD: AES S-box Input to Output'
c_model_enum_value = 3
c_model_enum_name = 'LEAK_HD_SBOX_IN_OUT'
def leakage(self, pt, ct, key, bnum):
@@ -207,7 +207,7 @@ def leakage(self, pt, ct, key, bnum):
return st1 ^ st2
class SBoxInputSuccessive(AESLeakageHelper):
- name = 'HD: AES SBox Input i to i+1'
+ name = 'HD: AES S-box Input i to i+1'
c_model_enum_value = 4
c_model_enum_name = 'LEAK_HD_SBOX_IN_SUCCESSIVE'
def leakage(self, pt, ct, key, bnum):
@@ -222,7 +222,7 @@ def leakage(self, pt, ct, key, bnum):
return st1 ^ st2
class SBoxOutputSuccessive(AESLeakageHelper):
- name = 'HD: AES SBox Output i to i+1'
+ name = 'HD: AES S-box Output i to i+1'
c_model_enum_value = 5
c_model_enum_name = 'LEAK_HD_SBOX_OUT_SUCCESSIVE'
def leakage(self, pt, ct, key, bnum):
@@ -349,7 +349,7 @@ def leakage(self, pt, ct, guess, bnum, state):
pt (list): Plaintext/textin
ct (list): Ciphertext/textout
guess (list): Key guess
- bnum (list): Subkey Byte Number
+ bnum (list): Subkey byte number
state (list): The state of the key finding
Returns:
@@ -402,7 +402,7 @@ def leakage(self, pt, ct, guess, bnum, state):
pt (list): Plaintext/textin
ct (list): Ciphertext/textout
guess (list): Key guess
- bnum (list): Subkey Byte Number
+ bnum (list): Subkey byte number
state (list): The state of the key finding
Returns:
@@ -439,7 +439,7 @@ def leakage(self, pt, ct, guess, bnum, state):
pt (list): Plaintext/textin
ct (list): Ciphertext/textout
guess (list): Key guess
- bnum (list): Subkey Byte Number
+ bnum (list): Subkey byte number
state (list): The state of the key finding
Returns:
@@ -483,7 +483,7 @@ def leakage(self, pt, ct, prev_pt, prev_ct, guess, bnum, state):
prev_pt (list): Plaintext/textin for the previous encryption
prev_ct (list): Ciphertext/textout for the previous encryption
guess (list): Key guess
- bnum (list): Subkey Byte Number
+ bnum (list): Subkey byte number
state (list): The state of the key finding
Returns:
diff --git a/software/chipwhisperer/analyzer/attacks/models/AES256_8bit.py b/software/chipwhisperer/analyzer/attacks/models/AES256_8bit.py
index 778c808bb5..46109f07ba 100644
--- a/software/chipwhisperer/analyzer/attacks/models/AES256_8bit.py
+++ b/software/chipwhisperer/analyzer/attacks/models/AES256_8bit.py
@@ -83,11 +83,11 @@ class AES(object):
0x21, 0x0c, 0x7d]
def getSBoxValue(self, num):
- """Retrieves a given S-Box Value"""
+ """Retrieves a given S-box value"""
return self.sbox[num]
def getSBoxInvert(self, num):
- """Retrieves a given Inverted S-Box Value"""
+ """Retrieves a given inverted S-box value"""
return self.rsbox[num]
def galois_multiplication(self, a, b):
@@ -202,7 +202,7 @@ def xtime(self, a):
return a
def HypHW(self, pt, ct, key, bnum):
- """Given either plaintext or ciphertext (not both) + a key guess, return hypothetical hamming weight of result"""
+ """Given either plaintext or ciphertext (not both) + a key guess, return hypothetical Hamming weight of result"""
if pt != None:
return self.HW[sbox(pt[bnum] ^ key)]
elif ct != None:
@@ -227,7 +227,7 @@ def HypHWXtime(self, pt, keyguess, numguess, keyknown, bnumknown):
return self.HW[xtime(a^b)]
def HypHD(self, pt, ct, key, bnum):
- """Given either plaintext or ciphertext (not both) + a key guess, return hypothetical hamming distance of result"""
+ """Given either plaintext or ciphertext (not both) + a key guess, return hypothetical Hamming distance of result"""
#Get output
if pt != None:
#TODO: This does't work too well, need to fix
diff --git a/software/chipwhisperer/analyzer/attacks/models/XOR.py b/software/chipwhisperer/analyzer/attacks/models/XOR.py
index bf6a2c6848..0bcbbf8a85 100644
--- a/software/chipwhisperer/analyzer/attacks/models/XOR.py
+++ b/software/chipwhisperer/analyzer/attacks/models/XOR.py
@@ -35,7 +35,7 @@ class XORLeakageHelper(object):
def leakage(self, pt, ct, key, bnum):
"""
- Override this function with specific leakage function (S-Box output, HD, etc).
+ Override this function with specific leakage function (S-box output, HD, etc).
Args:
pt: 16-byte plain-text input
diff --git a/software/chipwhisperer/analyzer/attacks/models/__init__.py b/software/chipwhisperer/analyzer/attacks/models/__init__.py
index 7dc75babd2..83327b7702 100644
--- a/software/chipwhisperer/analyzer/attacks/models/__init__.py
+++ b/software/chipwhisperer/analyzer/attacks/models/__init__.py
@@ -66,12 +66,12 @@ def plaintext_key_xor(self):
@property
def sbox_output(self):
- """Hamming weight of 1st round SBox output"""
+ """Hamming weight of 1st round S-box output"""
return AES128_8bit(aes128_leakage.SBox_output)
@property
def inverse_sbox_output(self):
- """Hamming weight of 1st round InvSBox (for decryption)"""
+ """Hamming weight of 1st round inverse S-box (for decryption)"""
return AES128_8bit(aes128_leakage.InvSBox_output)
@property
@@ -121,17 +121,17 @@ def last_round_state_diff_alternate(self):
@property
def sbox_in_out_diff(self):
- """Hamming distance between SBox input and output."""
+ """Hamming distance between S-box input and output."""
return AES128_8bit(aes128_leakage.SBoxInOutDiff)
@property
def sbox_input_successive(self):
- """Hamming distance between 2 AES sbox inputs"""
+ """Hamming distance between 2 AES S-box inputs"""
return AES128_8bit(aes128_leakage.SBoxInputSuccessive)
@property
def sbox_output_successive(self):
- """Hamming distance between 2 AES sbox outputs"""
+ """Hamming distance between 2 AES S-box outputs"""
return AES128_8bit(aes128_leakage.SBoxOutputSuccessive)
@property
@@ -146,7 +146,7 @@ def round_1_2_state_diff_key_mix(self):
@property
def round_1_2_state_diff_sbox(self):
- """Hamming distance between round 1 and round 2 sbox output"""
+ """Hamming distance between round 1 and round 2 S-box output"""
return AES128_8bit(aes128_leakage.Round1Round2StateDiff_SBox)
def __str__(self):
diff --git a/software/chipwhisperer/analyzer/attacks/models/aes/funcs.py b/software/chipwhisperer/analyzer/attacks/models/aes/funcs.py
index a82a775c61..c68b723004 100644
--- a/software/chipwhisperer/analyzer/attacks/models/aes/funcs.py
+++ b/software/chipwhisperer/analyzer/attacks/models/aes/funcs.py
@@ -170,51 +170,51 @@
def sbox(inp):
- """Perform an SBox lookup.
+ """Perform an S-box lookup.
Args:
- inp (int): Byte used for the Sbox lookup.
+ inp (int): Byte used for the S-box lookup.
Returns:
- int: The result of the SBox lookup.
+ int: The result of the S-box lookup.
"""
return _sbox[inp]
def inv_sbox(inp):
- """Perform an inverse SBox lookup.
+ """Perform an inverse S-box lookup.
Args:
- inp (int): Byte used for the inverse Sbox lookup.
+ inp (int): Byte used for the inverse S-box lookup.
Returns:
- int: The result of the inverse SBox lookup.
+ int: The result of the inverse S-box lookup.
"""
return _i_sbox[inp]
def subbytes(inp):
- """Perform an Sbox lookup for multiple bytes.
+ """Perform an S-box lookup for multiple bytes.
Args:
- inp (iterable): Bytes to perform Sbox lookup on.
+ inp (iterable): Bytes to perform S-box lookup on.
Returns:
list: List of bytes resulting from the multiple
- SBox lookups.
+ S-box lookups.
"""
return [sbox(i) for i in inp]
def inv_subbytes(inp):
- """Perform an inverse Sbox lookup for multiple bytes.
+ """Perform an inverse S-box lookup for multiple bytes.
Args:
- inp (iterable): Bytes to perform inverse Sbox lookup on.
+ inp (iterable): Bytes to perform inverse S-box lookup on.
Returns:
list: List of bytes resulting from the multiple
- inverse SBox lookups.
+ inverse S-box lookups.
"""
return [inv_sbox(i) for i in inp]
diff --git a/software/chipwhisperer/analyzer/attacks/models/base.py b/software/chipwhisperer/analyzer/attacks/models/base.py
index ec3ac79ced..89a3a2f547 100644
--- a/software/chipwhisperer/analyzer/attacks/models/base.py
+++ b/software/chipwhisperer/analyzer/attacks/models/base.py
@@ -19,7 +19,7 @@
from chipwhisperer.common.utils import util
import numpy as np
-#The following is placed here for backwards compatability with imports expected the getHW function
+#The following is placed here for backwards compatibility with imports expected the getHW function
_HW = [0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3,
4, 2, 3, 3, 4, 3, 4, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4,
4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 1, 2, 2, 3, 2,
@@ -66,7 +66,7 @@ def __init__(self, numSubKeys=None, permPerSubkey=None, model=None):
self.permPerSubkey = permPerSubkey
self.numRoundKeys = 0
self.model = model
- #Update interal models (if required)
+ #Update interval models (if required)
self._updateHwModel()
if model.name in self.hwModels:
diff --git a/software/chipwhisperer/analyzer/attacks/snr.py b/software/chipwhisperer/analyzer/attacks/snr.py
index 6964c71893..705ec9a904 100644
--- a/software/chipwhisperer/analyzer/attacks/snr.py
+++ b/software/chipwhisperer/analyzer/attacks/snr.py
@@ -40,7 +40,7 @@ def calculate_snr(input, leak_model, bnum=0, db=True):
leak_model (ModelsBase): A leakage model selected from
:data:`leakage_models `.
bnum (int): Byte number used for leakage model.
- bd (bool): Return signal-to-noise ratio in decibals.
+ bd (bool): Return signal-to-noise ratio in decibels.
"""
textin = None
diff --git a/software/chipwhisperer/analyzer/preprocessing/add_noise_jitter.py b/software/chipwhisperer/analyzer/preprocessing/add_noise_jitter.py
index 65b58d3d83..c6210a55fc 100644
--- a/software/chipwhisperer/analyzer/preprocessing/add_noise_jitter.py
+++ b/software/chipwhisperer/analyzer/preprocessing/add_noise_jitter.py
@@ -35,7 +35,7 @@ class AddNoiseJitter(PreprocessingBase):
"""Add random time jitter to each of the traces.
"""
_name = "Add Noise: Time Jitter"
- _description = "Add random jitter. This module is used for testing resyncronization modules, and has no use " \
+ _description = "Add random jitter. This module is used for testing resynchronization modules, and has no use " \
"in actual analysis."
def __init__(self, traceSource=None, name=None):
diff --git a/software/chipwhisperer/analyzer/preprocessing/add_noise_random.py b/software/chipwhisperer/analyzer/preprocessing/add_noise_random.py
index b4b162edd8..23697bae33 100644
--- a/software/chipwhisperer/analyzer/preprocessing/add_noise_random.py
+++ b/software/chipwhisperer/analyzer/preprocessing/add_noise_random.py
@@ -57,7 +57,7 @@ def noise(self):
If 0, the traces are passed through without being modified. Otherwise,
random values from N(0, noise) are added to each of the points.
- Setter raises TypeError if noise level isn't a number
+ Setter raises TypeError if noise level isn't a number.
"""
return self._getNoise()
diff --git a/software/chipwhisperer/analyzer/preprocessing/decimation_clock_recovery.py b/software/chipwhisperer/analyzer/preprocessing/decimation_clock_recovery.py
index 185b11b7ca..1164d43bfd 100644
--- a/software/chipwhisperer/analyzer/preprocessing/decimation_clock_recovery.py
+++ b/software/chipwhisperer/analyzer/preprocessing/decimation_clock_recovery.py
@@ -48,7 +48,7 @@ def fft(signal, freq=None):
class DecimationClockRecovery(PreprocessingBase):
"""
- Attempts Clock recovery & then decimates based on that. Currently broken.
+ Attempts clock recovery & then decimates based on that. Currently broken.
"""
_name = "Decimation: Clock Recovery"
_description = "Attempts to 'recover' the clock by band-pass filtering, and then uses that to "\
@@ -126,7 +126,7 @@ def getTrace(self, n):
# if you only api a waveform AFTER the trigger, this means you need to
# throw away data from the api until the filter is running. If the system
# clock frequency changes, you've now thrown away a differing amount of clock
- # cycles and syncronization is lost.
+ # cycles and synchronization is lost.
#
# For now we just throw away a fixed number of samples, but it doesn't work for varying
# clock frequencies.
diff --git a/software/chipwhisperer/analyzer/preprocessing/resync_cross_correlation.py b/software/chipwhisperer/analyzer/preprocessing/resync_cross_correlation.py
index 2f686d9b7f..3218a77a15 100644
--- a/software/chipwhisperer/analyzer/preprocessing/resync_cross_correlation.py
+++ b/software/chipwhisperer/analyzer/preprocessing/resync_cross_correlation.py
@@ -34,7 +34,7 @@
class ResyncCrossCorrelation(PreprocessingBase):
"""
- Cross-Correlation Resyncronization
+ Cross-Correlation Resynchronization
"""
_name = "Resync: Cross Correlation"
_description = "Use cross-correlation to detect shift between a 'reference trace' and every input trace. "\
diff --git a/software/chipwhisperer/analyzer/preprocessing/resync_peak_detect.py b/software/chipwhisperer/analyzer/preprocessing/resync_peak_detect.py
index eed3f44845..e42f73dc59 100644
--- a/software/chipwhisperer/analyzer/preprocessing/resync_peak_detect.py
+++ b/software/chipwhisperer/analyzer/preprocessing/resync_peak_detect.py
@@ -33,7 +33,7 @@
class ResyncPeakDetect(PreprocessingBase):
"""
- Resyncronize based on peak value.
+ Resynchronize based on peak value.
"""
_name = "Resync: Peak Detect"
_description = "Line up traces so peak (either max positive or max negative) within" \
diff --git a/software/chipwhisperer/analyzer/utils/Partition.py b/software/chipwhisperer/analyzer/utils/Partition.py
index 50af190d1f..4000a87bb2 100644
--- a/software/chipwhisperer/analyzer/utils/Partition.py
+++ b/software/chipwhisperer/analyzer/utils/Partition.py
@@ -106,7 +106,7 @@ class PartitionRandvsFixed(object):
for a given key length.
"""
- sectionName = "Partition Based on Rand vs Fixed "
+ sectionName = "Partition Based on Rand vs Fixed"
partitionType = "Rand vs Fixed"
def getNumPartitions(self):
@@ -145,7 +145,7 @@ def getPartitionNum(self, trace, tnum):
class Partition(Parameterized):
"""
- Base Class for all partioning modules
+ Base Class for all partitioning modules
"""
# traceDone = Signal(int)
@@ -174,7 +174,7 @@ def setPartMethod(self, method):
self.attrDictPartition["moduleName"] = self.partMethod.__class__.__name__
def init(self):
- """Do any initilization required once all traces are loaded"""
+ """Do any initialization required once all traces are loaded"""
pass
def createBlankTable(self, num_keys, num_parts):
diff --git a/software/chipwhisperer/analyzer/utils/fasterdtw.py b/software/chipwhisperer/analyzer/utils/fasterdtw.py
index c053d8a20e..4ac86ae65b 100644
--- a/software/chipwhisperer/analyzer/utils/fasterdtw.py
+++ b/software/chipwhisperer/analyzer/utils/fasterdtw.py
@@ -63,17 +63,17 @@
def fastdtw(x, y, radius=1, dist=None):
- ''' return the approximate distance between 2 time series with O(N)
+ ''' Return the approximate distance between 2 time series with O(N)
time and memory complexity
Parameters
----------
x : array_like
- input array 1
+ Input array 1
y : array_like
- input array 2
+ Input array 2
radius : int
- size of neighborhood when expanding the path. A higher value will
+ Size of neighborhood when expanding the path. A higher value will
increase the accuracy of the calculation but also increase time
and memory consumption. A radius equal to the size of x and y will
yield an exact dynamic time warping calculation.
@@ -86,7 +86,7 @@ def fastdtw(x, y, radius=1, dist=None):
Returns
-------
float
- the approximate distance between the 2 time series
+ The approximate distance between the 2 time series
Examples
--------
@@ -140,14 +140,14 @@ def __fastdtw(x, y, radius, dist):
def dtw(x, y, window=None, dist=lambda a, b: abs(a - b)):
- ''' return the distance between 2 time series without approximation
+ ''' Teturn the distance between 2 time series without approximation
Parameters
----------
x : array_like
- input array 1
+ Input array 1
y : array_like
- input array 2
+ Input array 2
dist : function or int
The method for calculating the distance between x[i] and y[j]. If
dist is an int of value p > 0, then the p-norm will be used. If
@@ -157,7 +157,7 @@ def dtw(x, y, window=None, dist=lambda a, b: abs(a - b)):
Returns
-------
float
- the approximate distance between the 2 time series
+ The approximate distance between the 2 time series
Examples
--------
diff --git a/software/chipwhisperer/capture/api/cwcommon.py b/software/chipwhisperer/capture/api/cwcommon.py
index 30a126e350..7e4e847ce9 100644
--- a/software/chipwhisperer/capture/api/cwcommon.py
+++ b/software/chipwhisperer/capture/api/cwcommon.py
@@ -156,7 +156,7 @@ def sam_build_date(self) -> str:
"""The date the SAM3U firmware was built on
.. versionadded:: 5.6.1
- Added sam build date to chipwhisperer
+ Added sam build date to ChipWhisperer
"""
return self._getNAEUSB().get_fw_build_date()
@@ -190,7 +190,7 @@ def reset_sam3u(self):
"""Reset the ChipWhisperer's microcontroller
.. versionadded:: 5.6.1
- Add common cw interface
+ Add common CW interface
"""
self._getNAEUSB().reset()
diff --git a/software/chipwhisperer/capture/api/programmers.py b/software/chipwhisperer/capture/api/programmers.py
index cd47c82e1a..67cdaba4ef 100644
--- a/software/chipwhisperer/capture/api/programmers.py
+++ b/software/chipwhisperer/capture/api/programmers.py
@@ -88,15 +88,15 @@ def autoProgram(self, hexfile, erase, verify, logfunc, waitfunc):
raise NotImplementedError
def save_and_restore_pins(func):
- """Decorator to save and restore pins needed to comunicate and program hardware
+ """Decorator to save and restore pins needed to communicate and program hardware
Purpose: to move from changing pins in the background needed to communicate
with the hardware and leaving them changed (very confusing), to saving the
pin states before the function is called, changing them during function
- executation and restoring them after the function is done executing
+ execution and restoring them after the function is done executing
(less confusing).
"""
- @wraps(func) # updates func_wrapper aatributes to be same
+ @wraps(func) # updates func_wrapper attributes to be same
def func_wrapper(self : Programmer, *args, **kwargs):
#If no scope, we don't do any pin magic
diff --git a/software/chipwhisperer/capture/scopes/OpenADC.py b/software/chipwhisperer/capture/scopes/OpenADC.py
index 095cce6fea..f8062f13f2 100644
--- a/software/chipwhisperer/capture/scopes/OpenADC.py
+++ b/software/chipwhisperer/capture/scopes/OpenADC.py
@@ -45,7 +45,7 @@ class OpenADC(util.DisableNewAttr, ChipWhispererCommonInterface):
"""OpenADC scope object.
This class contains the public API for the OpenADC hardware, including the
- ChipWhisperer Lite/ CW1200 Pro boards. It includes specific settings for
+ CWLite/CW1200 Pro boards. It includes specific settings for
each of these devices.
To connect to one of these devices, the easiest method is::
@@ -83,7 +83,7 @@ class OpenADC(util.DisableNewAttr, ChipWhispererCommonInterface):
* :attr:`scope.DecodeIO `
* :attr:`scope.adc.stream_mode `
- If you have a CW-Husky, you have access to even more additional features:
+ If you have a CWHusky, you have access to even more additional features:
* :attr:`scope.SAD `
* :attr:`scope.LA `
@@ -173,7 +173,7 @@ def enable_MPSSE(self, enable=True, husky_userio=None, scope_default_setup=True)
Args:
enable (bool): Enable or disable. Optional, defaults to True
husky_userio (str or None): Enables communication using the Husky's user IO pins.
- If "jtag", route jtag over those pins. If "swd", route swd. If None, do not route.
+ If "jtag", route JTAG over those pins. If "swd", route SWD. If None, do not route.
Optional, defaults to None
scope_default_setup (bool): Calls `default_setup()` before enabling JTAG mode (resets clock,
IOs, etc to default). Useful when working with standard targets, but set this to `False`
@@ -194,7 +194,7 @@ def enable_MPSSE(self, enable=True, husky_userio=None, scope_default_setup=True)
elif husky_userio == "swd":
self.userio.mode = "target_debug_swd"
else:
- raise ValueError("Invalid husky userio mode: {}".format(husky_userio))
+ raise ValueError("Invalid Husky userio mode: {}".format(husky_userio))
self._getNAEUSB().set_husky_tms_wr(1)
super().enable_MPSSE(enable)
@@ -377,7 +377,7 @@ def default_setup(self, verbose=True, sleep=0.2):
raise OSError("Could not lock DCM. Try rerunning this function or calling scope.clock.reset_dcms(): {}".format(self))
if verbose:
- # on CW-lite, although scope.clock.adc_locked may indicate true, if we read scope.clock.adc_freq right now we'll get (and cache)
+ # on CWLite, although scope.clock.adc_locked may indicate true, if we read scope.clock.adc_freq right now we'll get (and cache)
# an unsettled value, so let's wait a bit:
if not self._is_husky:
time.sleep(sleep)
@@ -440,7 +440,7 @@ def get_name(self):
return "ChipWhisperer Husky Plus"
def adc_test(self, samples=131070, reps=3, verbose=False):
- """Run a series of ADC sampling tests on CW-Husky.
+ """Run a series of ADC sampling tests on CWHusky.
Useful when pushing the ADC sampling frequency, to get an idea (but
not a guarantee!) of whether Husky is able to sample properly at
@@ -612,14 +612,14 @@ def fpga_buildtime(self):
"""When the FPGA bitfile was generated. Husky only.
"""
if not self._is_husky:
- raise ValueError("For CW-Husky only.")
+ raise ValueError("For CWHusky only.")
return self.sc.hwInfo.get_fpga_buildtime()
def reset_fpga(self):
"""Reset Husky FPGA. This causes all FPGA-based settings to return to their default values.
"""
if not self._is_husky:
- raise ValueError("For CW-Husky only.")
+ raise ValueError("For CWHusky only.")
self.sc.reset_fpga()
self.adc._clear_caches()
self.sc._clear_caches()
@@ -630,7 +630,7 @@ def _get_fpga_programmer(self):
return self.scopetype.fpga
def con(self, sn=None, idProduct=None, bitstream=None, force=False, prog_speed=10E6, **kwargs):
- """Connects to attached chipwhisperer hardware (Lite, Pro, or Husky)
+ """Connects to attached ChipWhisperer hardware (Lite, Pro, or Husky)
Args:
sn (str): The serial number of the attached device. Does not need to
@@ -884,8 +884,8 @@ def get_last_trace(self, as_int : bool=False) -> np.ndarray:
Floating point values are scaled and shifted to be between -0.5 and 0.5.
- Integer values are raw readings from the ChipWhisperer ADC. The ChipWhisperer-Lite
- has a 10-bit ADC, the Nano has an 8-bit ADC, and the Husky can read either
+ Integer values are raw readings from the ChipWhisperer ADC. The CWLite
+ has a 10-bit ADC, the CWNano has an 8-bit ADC, and the CWHusky can read either
8-bits or 12-bits of ADC data.
Args:
@@ -914,7 +914,7 @@ def capture_segmented(self):
enough triggers for segmented mode.
Returns:
- True if capture timed out, false if it didn't.
+ True if capture timed out, False if it didn't.
Raises:
IOError: Unknown failure.
@@ -938,7 +938,7 @@ def capture_segmented(self):
return timeout or timeout2
def get_last_trace_segmented(self):
- """Return last trace assuming it was captued with segmented mode.
+ """Return last trace assuming it was captured with segmented mode.
NOTE: The length of each returned trace is 1 less sample than requested.
diff --git a/software/chipwhisperer/capture/scopes/_OpenADCInterface.py b/software/chipwhisperer/capture/scopes/_OpenADCInterface.py
index e9759b8d46..db85091943 100644
--- a/software/chipwhisperer/capture/scopes/_OpenADCInterface.py
+++ b/software/chipwhisperer/capture/scopes/_OpenADCInterface.py
@@ -419,10 +419,10 @@ def fpga_read(self, address, num_bytes):
return self.msg_read(address, maxResp=num_bytes)
def reset_fpga(self):
- """ Reset all FPGA resgiters to their defaults.
+ """ Reset all FPGA registers to their defaults.
"""
if not self._is_husky:
- raise ValueError("For CW-Husky only.")
+ raise ValueError("For CWHusky only.")
self.sendMessage(CODE_WRITE, "RESET", [1])
self.sendMessage(CODE_WRITE, "RESET", [0])
@@ -487,7 +487,7 @@ def updateStreamBuffer(self, samples=None):
# need to capture a multiple of 3 otherwise processHuskyData may fail
sbuf_len += 3 - sbuf_len % 3
self._sbuf = array.array('B', [0]) * sbuf_len
- # For CW-Pro, _stream_len is the number of (10-bit) samples (which was previously set), whereas for Husky, to accomodate 8/12-bit samples,
+ # For CWPro, _stream_len is the number of (10-bit) samples (which was previously set), whereas for Husky, to accomodate 8/12-bit samples,
# it's the total number of bytes, so we need to update _stream_len accordingly:
self._stream_len = sbuf_len
else:
@@ -528,7 +528,7 @@ def decimate(self):
def set_clip_errors_disabled(self, disable):
if not self._is_husky:
- raise ValueError("For CW-Husky only.")
+ raise ValueError("For CWHusky only.")
raw = self.sendMessage(CODE_READ, "NO_CLIP_ERRORS", maxResp=1)[0]
if disable:
raw |= 1 # set bit 0
@@ -538,7 +538,7 @@ def set_clip_errors_disabled(self, disable):
def clip_errors_disabled(self):
if not self._is_husky:
- raise ValueError("For CW-Husky only.")
+ raise ValueError("For CWHusky only.")
if self.sendMessage(CODE_READ, "NO_CLIP_ERRORS", maxResp=1)[0] & 1:
return True
else:
@@ -546,7 +546,7 @@ def clip_errors_disabled(self):
def set_lo_gain_errors_disabled(self, disable):
if not self._is_husky:
- raise ValueError("For CW-Husky only.")
+ raise ValueError("For CWHusky only.")
raw = self.sendMessage(CODE_READ, "NO_CLIP_ERRORS", maxResp=1)[0]
if disable:
raw |= 2 # set bit 1
@@ -556,7 +556,7 @@ def set_lo_gain_errors_disabled(self, disable):
def lo_gain_errors_disabled(self):
if not self._is_husky:
- raise ValueError("For CW-Husky only.")
+ raise ValueError("For CWHusky only.")
if self.sendMessage(CODE_READ, "NO_CLIP_ERRORS", maxResp=1)[0] & 2:
return True
else:
@@ -709,13 +709,13 @@ def capture(self, offset=None, adc_freq=29.53E6, samples=24400, segments=1, segm
self.arm(False)
if self._is_husky and self.sendMessage(CODE_READ, "FIFO_STAT", maxResp=1)[0] & 0x0f:
- scope_logger.warning("FIFO error occured; see scope.adc.errors for details.")
+ scope_logger.warning("FIFO error occurred; see scope.adc.errors for details.")
if stream_timeout:
if self._stream_rx_bytes == 0: # == (self._stream_len - 3072):
- scope_logger.warning("Streaming mode OVERFLOW occured as trigger too fast - Adjust offset upward (suggest = 200 000)")
+ scope_logger.warning("Streaming mode OVERFLOW occurred as trigger too fast - Adjust offset upward (suggest = 200 000)")
else:
- scope_logger.warning("Streaming mode OVERFLOW occured during capture - ADC sample clock probably too fast for stream mode (keep ADC Freq < 10 MHz)")
+ scope_logger.warning("Streaming mode OVERFLOW occurred during capture - ADC sample clock probably too fast for stream mode (keep ADC Freq < 10 MHz)")
timeout = True
else:
status = self.getStatus()
@@ -1057,7 +1057,7 @@ def processData(self, data, pad=float('NaN'), debug=False):
self._int_data = np.append([0x00]*diff, self._int_data)
scope_logger.debug("Diff > 0, fpData: {}, int_data: {}".format(len(fpData), len(self._int_data)))
scope_logger.warning('Pretrigger not met: Do not use downsampling and pretriggering at same time.')
- scope_logger.debug('Pretrigger not met: can attempt to increase presampleTempMargin(in the code).')
+ scope_logger.debug('Pretrigger not met: can attempt to increase presampleTempMargin (in the code).')
else:
scope_logger.debug("Diff <= 0, fpData: {}, int_data: {}".format(len(fpData), len(self._int_data)))
fpData = fpData[-diff:]
@@ -1290,7 +1290,7 @@ def mode(self, val):
return self.setMode(val)
def setGain(self, gain):
- '''Set the Gain range: 0-78 for CW-Lite and CW-Pro; 0-109 for CW-Husky
+ '''Set the Gain range: 0-78 for CWLite and CWPro; 0-109 for CWHusky
:meta private:
@@ -1485,7 +1485,7 @@ def state(self):
@property
def stream_mode(self):
- """The ChipWhisperer's streaming status. Only available on CW1200 and CW-Husky.
+ """The ChipWhisperer's streaming status. Only available on CW1200 and CWHusky.
When stream mode is enabled, the ChipWhisperer sends back ADC data as
soon as it is recorded. In this mode, there is no hardware limit on the
@@ -1508,7 +1508,7 @@ def stream_mode(self, enabled):
@property
def stream_segment_threshold(self):
- """Only available on CW-Husky. ** Internal parameter which should not
+ """Only available on CWHusky. ** Internal parameter which should not
be tweaked unless you know what you're doing. **
For streaming, this many samples must be available to be read from the
@@ -1531,7 +1531,7 @@ def stream_segment_threshold(self, size):
@property
def stream_segment_size(self):
- """Only available on CW-Husky. ** Internal parameter which should not
+ """Only available on CWHusky. ** Internal parameter which should not
be tweaked unless you know what you're doing. **
For streaming, this is the size of the burst that the SAM3U reads from
@@ -1613,9 +1613,9 @@ def samples(self):
"""The number of ADC samples to record in a single capture.
The maximum number of samples is hardware-dependent:
- - cwlite: 24400
- - cw1200: 96000
- - cwhusky: 131070
+ - CWLite: 24400
+ - CW1200: 96000
+ - CWHusky: 131070
:Getter: Return the current number of total samples (integer)
@@ -1650,7 +1650,7 @@ def fifo_state(self):
"""Husky only, for debugging; state of the Husky FIFO FSM.
"""
if not self._is_husky:
- raise ValueError("For CW-Husky only.")
+ raise ValueError("For CWHusky only.")
state = self.oa.sendMessage(CODE_READ, "FIFO_STATE", maxResp=1)[0]
if state == 0:
return 'IDLE'
@@ -1798,14 +1798,14 @@ def trig_count(self) -> int:
@property
def fifo_fill_mode(self) -> str:
- """The ADC buffer fill strategy - allows segmented usage for CW-lite and CW-pro.
+ """The ADC buffer fill strategy - allows segmented usage for CWLite and CWPro.
.. warning:: THIS REQUIRES NEW FPGA BITSTREAM - NOT YET IN THE PYTHON.
Only the 'Normal' mode is well supported, the other modes can
be used carefully.
- For segmenting on CW-Husky, see 'segments' instead.
+ For segmenting on CWHusky, see 'segments' instead.
There are four possible modes:
* "normal": Trigger line & logic work as expected.
@@ -1817,7 +1817,7 @@ def fifo_fill_mode(self) -> str:
of 3 (will be enforced by API).
.. warning:: The "enable" and "segment" modes requires you to fill
- the **full buffer** (~25K on CW-Lite, ~100K on CW-Pro).
+ the **full buffer** (~25K on CWLite, ~100K on CWPro).
This requires you to ensure the physical trigger line will
be high (enable mode) or toggle (segment mode) enough. The
ChipWhisperer hardware will currently stall until the
@@ -1883,8 +1883,8 @@ def _set_fifo_fill_mode(self, mode):
def segments(self) -> int:
"""Number of sample segments to capture.
- .. warning:: Supported by CW-Husky only. For segmenting on CW-lite or
- CW-pro, see 'fifo_fill_mode' instead.
+ .. warning:: Supported by CWHusky only. For segmenting on CWLite or
+ CWPro, see 'fifo_fill_mode' instead.
This setting must be a 16-bit positive integer.
@@ -1922,7 +1922,7 @@ def segments(self) -> int:
@segments.setter
def segments(self, num : int):
if num < 1 or num > 2**16-1 or not type(num) is int or not self._is_husky:
- raise ValueError("Number of segments must be in range [1, 2^16-1]. For CW-Husky only.")
+ raise ValueError("Number of segments must be in range [1, 2^16-1]. For CWHusky only.")
self._cached_segments = num
self._set_segments(num)
@@ -1946,7 +1946,7 @@ def _set_segments(self, num):
def errors(self) -> Union[str, bool, int]:
"""Internal error flags (FPGA FIFO over/underflow)
- .. warning:: Supported by CW-Husky only.
+ .. warning:: Supported by CWHusky only.
Error types and their causes:
* 'presample error': capture trigger occurs before the requested
@@ -1992,7 +1992,7 @@ def errors(self) -> Union[str, bool, int]:
def errors(self, val : Any):
"""Internal error flags (FPGA FIFO over/underflow)
- .. warning:: Supported by CW-Husky only.
+ .. warning:: Supported by CWHusky only.
"""
self.oa.sendMessage(CODE_WRITE, "FIFO_STAT", [1])
@@ -2003,13 +2003,13 @@ def errors(self, val : Any):
def first_error(self):
"""Reports the first error that was flagged (self.errors reports *all* errors). Useful for debugging. Read-only.
- .. warning:: Supported by CW-Husky only.
+ .. warning:: Supported by CWHusky only.
:Getter: Return the error flags.
"""
if not self._is_husky:
- raise ValueError("For CW-Husky only.")
+ raise ValueError("For CWHusky only.")
return self._get_errors("FIFO_FIRST_ERROR")
@@ -2017,13 +2017,13 @@ def first_error(self):
def first_error_state(self) -> str:
"""Reports the state the FPGA FSM state at the time of the first flagged error. Useful for debugging. Read-only.
- .. warning:: Supported by CW-Husky only.
+ .. warning:: Supported by CWHusky only.
:Getter: Return the error flags.
"""
if not self._is_husky:
- raise ValueError("For CW-Husky only.")
+ raise ValueError("For CWHusky only.")
raw = self.oa.sendMessage(CODE_READ, "FIFO_FIRST_ERROR", maxResp=3)[2]
if raw == 0: return "IDLE"
elif raw == 1: return "PRESAMP_FILLING"
@@ -2064,8 +2064,8 @@ def _get_errors(self, addr):
def segment_cycles(self) -> int:
"""Number of clock cycles separating segments.
- .. warning:: Supported by CW-Husky only. For segmenting on CW-lite or
- CW-pro, see 'fifo_fill_mode' instead.
+ .. warning:: Supported by CWHusky only. For segmenting on CWLite or
+ CWPro, see 'fifo_fill_mode' instead.
This setting must be a 20-bit positive integer.
@@ -2098,7 +2098,7 @@ def segment_cycles(self) -> int:
@segment_cycles.setter
def segment_cycles(self, num : int):
if num < 0 or num > 2**20-1 or not type(num) is int or not self._is_husky:
- raise ValueError("Number of segments must be in range [0, 2^20-1]. For CW-Husky only.")
+ raise ValueError("Number of segments must be in range [0, 2^20-1]. For CWHusky only.")
self._cached_segment_cycles = num
self._set_segment_cycles(num)
@@ -2122,8 +2122,8 @@ def _set_segment_cycles(self, num):
def segment_cycle_counter_en(self) -> bool:
"""Number of clock cycles separating segments.
- .. warning:: Supported by CW-Husky only. For segmenting on CW-lite or
- CW-pro, see 'fifo_fill_mode' instead.
+ .. warning:: Supported by CWHusky only. For segmenting on CWLite or
+ CWPro, see 'fifo_fill_mode' instead.
Set to 0 to capture a new power trace segment every time the target
issues a trigger event.
@@ -2136,7 +2136,7 @@ def segment_cycle_counter_en(self) -> bool:
:Setter: Set segment_cycles.
"""
if not self._is_husky:
- raise ValueError("For CW-Husky only.")
+ raise ValueError("For CWHusky only.")
raw = self.oa.sendMessage(CODE_READ, "SEGMENT_CYCLE_COUNTER_EN", Validate=False, maxResp=1)[0]
if raw == 1:
return True
@@ -2157,7 +2157,7 @@ def segment_cycle_counter_en(self, enable : bool):
def _set_stream_mode(self, enabled):
if self._is_lite:
- raise ValueError("Not supported on CW-Lite.")
+ raise ValueError("Not supported on CWLite.")
self._stream_mode = enabled
#Write to FPGA
@@ -2216,7 +2216,7 @@ def _get_test_mode(self):
@property
def test_mode(self):
- """The ChipWhisperer's test mode. Only available on CW-Husky.
+ """The ChipWhisperer's test mode. Only available on CWHusky.
When test mode is enabled, an internally-generated count-up pattern is
captured, instead of the ADC sample data.
@@ -2256,7 +2256,7 @@ def _get_bits_per_sample(self):
@property
def bits_per_sample(self) -> int:
- """Bits per ADC sample. Only available on CW-Husky.
+ """Bits per ADC sample. Only available on CWHusky.
Husky has a 12-bit ADC; optionally, we read back only 8 bits per
sample. This does *not* allow for more samples to be collected; it
@@ -2273,7 +2273,7 @@ def bits_per_sample(self, bits : int):
if bits not in [8,12]:
raise ValueError("Valid settings: 8 or 12.")
if not self._is_husky:
- raise ValueError('For CW-Husky only.')
+ raise ValueError('For CWHusky only.')
self._set_bits_per_sample(bits)
@@ -2366,13 +2366,13 @@ def _set_presamples(self, samples):
self.presamples_desired = samples
if self._is_pro or self._is_lite or self._is_husky:
- #CW-1200 Hardware / CW-Lite / CW-Husky
+ # CW1200 Hardware / CWLite / CWHusky
samplesact = int(samples)
self.presamples_actual = samplesact
else:
#Other Hardware
if samples > 0:
- scope_logger.warning('Pre-sample on CW-Lite is unreliable with many FPGA bitstreams. '
+ scope_logger.warning('Pre-sample on CWLite is unreliable with many FPGA bitstreams. '
'Check data is reliably recorded before using in capture.')
#enforce samples is multiple of 3
@@ -2409,7 +2409,7 @@ def _get_presamples(self, cached=False):
temp = self.oa.sendMessage(CODE_READ, "PRESAMPLES_ADDR", maxResp=presamp_bytes)
samples = int.from_bytes(temp, byteorder='little')
- #CW1200/CW-Lite/Husky reports presamples using different method
+ # CW1200/CWLite/Husky reports presamples using different method
if self._is_pro or self._is_lite or self._is_husky:
self.presamples_actual = samples
diff --git a/software/chipwhisperer/capture/scopes/cwhardware/ChipWhispererExtra.py b/software/chipwhisperer/capture/scopes/cwhardware/ChipWhispererExtra.py
index 6b21a8c1e3..aa8fa1ca4a 100644
--- a/software/chipwhisperer/capture/scopes/cwhardware/ChipWhispererExtra.py
+++ b/software/chipwhisperer/capture/scopes/cwhardware/ChipWhispererExtra.py
@@ -307,7 +307,7 @@ def set_tio_pin_mode(self, io_num, mode):
return self.set_ioroute_value(io_num, mode)
def get_xio_index(self, io_num):
- """Gets a bitmask for a valid Extra IO pin for the IROUTE state.
+ """Gets a bitmask for a valid Extra IO pin for the IOROUTE state.
Return:
A bitmask representing the CTL IO pin.
@@ -1152,7 +1152,7 @@ def aux_io_mcx(self) -> str:
* "hs2": output: provide the same clock that's on HS2.
"""
if not self._is_husky:
- raise ValueError("For CW-Husky only.")
+ raise ValueError("For CWHusky only.")
data = self.cwe.oa.sendMessage(CODE_READ, "CW_AUX_IO", Validate=False, maxResp=1)[0]
if data & 0x01:
return "hs2"
@@ -1162,7 +1162,7 @@ def aux_io_mcx(self) -> str:
@aux_io_mcx.setter
def aux_io_mcx(self, state : str):
if not self._is_husky:
- raise ValueError("For CW-Husky only.")
+ raise ValueError("For CWHusky only.")
data = self.cwe.oa.sendMessage(CODE_READ, "CW_AUX_IO", Validate=False, maxResp=1)[0]
if state == 'high_z':
data &= 0xfe
@@ -1182,7 +1182,7 @@ def glitch_trig_mcx(self) -> str:
* "inverted [glitch | trigger]": inverted glitch or trigger signal
"""
if not self._is_husky:
- raise ValueError("For CW-Husky only.")
+ raise ValueError("For CWHusky only.")
data = self.cwe.oa.sendMessage(CODE_READ, "CW_AUX_IO", Validate=False, maxResp=1)[0]
if data & 0x04:
setting = 'inverted '
@@ -1197,7 +1197,7 @@ def glitch_trig_mcx(self) -> str:
@glitch_trig_mcx.setter
def glitch_trig_mcx(self, state : str):
if not self._is_husky:
- raise ValueError("For CW-Husky only.")
+ raise ValueError("For CWHusky only.")
data = self.cwe.oa.sendMessage(CODE_READ, "CW_AUX_IO", Validate=False, maxResp=1)[0]
if 'trigger' in state:
data &= 0xfd
@@ -1591,7 +1591,7 @@ def triggers(self):
* "tio1 NAND tio2 NAND sma"
* "nrst"
- Examples of unallowed trigger inputs:
+ Examples of prohibited trigger inputs:
* "tio1 tio2"
* "tio1 AND tio2 OR tio3"
@@ -1822,7 +1822,7 @@ def __init__(self, *args, **kwargs):
class HuskyTrigger(TriggerSettings):
"""Husky trigger object.
- Communicates with all the trigger modules inside CW-Husky.
+ Communicates with all the trigger modules inside CWHusky.
Usage depends on the active trigger module.
"""
MODULE = {'basic': 0x00,
@@ -1950,7 +1950,7 @@ def sad_always_active(self, enable):
def module(self):
"""The trigger module in use.
- The trigger modules available depend on the hardware. On the CWLite,
+ The trigger modules available depend on the hardware. On the Lite,
only the basic trigger module can be used; on the CW1200, the serial
data and SAD triggers are available too.
@@ -2181,7 +2181,7 @@ def _check_windows(self, starts, ends):
@property
def level(self):
- """For triggering on ADC sample exceeding a treshold,
+ """For triggering on ADC sample exceeding a threshold,
when scope.trigger.module = 'ADC'.
Sets the trigger threshold, in the range [-0.5, 0.5].
@@ -2475,40 +2475,40 @@ def setupClockSource(self, diff=True, useIN0=False, useIN1=False):
def readByte(self, regaddr, slaveaddr=0x69):
d = bytearray([0x00, 0x80 | 0x69, 0x80 | regaddr])
- self.oa.sendMessage(CODE_WRITE, ADDR_I2CSTATUS, d, Validate=False)
+ self.oa.sendMessage(CODE_WRITE, self.ADDR_I2CSTATUS, d, Validate=False)
time.sleep(0.001)
d = bytearray([0x04, 0x80 | 0x69, 0x80 | regaddr])
- self.oa.sendMessage(CODE_WRITE, ADDR_I2CSTATUS, d, Validate=False)
+ self.oa.sendMessage(CODE_WRITE, self.ADDR_I2CSTATUS, d, Validate=False)
time.sleep(0.001)
d = bytearray([0x00, 0x80 | 0x69, 0x80 | regaddr])
- self.oa.sendMessage(CODE_WRITE, ADDR_I2CSTATUS, d, Validate=False)
+ self.oa.sendMessage(CODE_WRITE, self.ADDR_I2CSTATUS, d, Validate=False)
time.sleep(0.001)
- stat = self.oa.sendMessage(CODE_READ, ADDR_I2CSTATUS, Validate=False, maxResp=3)
+ stat = self.oa.sendMessage(CODE_READ, self.ADDR_I2CSTATUS, Validate=False, maxResp=3)
if stat[0] & 0x01:
raise IOError("No ACK from Slave in I2C")
- stat = self.oa.sendMessage(CODE_READ, ADDR_I2CDATA, Validate=False, maxResp=1)
+ stat = self.oa.sendMessage(CODE_READ, self.ADDR_I2CDATA, Validate=False, maxResp=1)
return stat[0]
def writeByte(self, regaddr, data, slaveaddr=0x69):
d = bytearray([data])
- self.oa.sendMessage(CODE_WRITE, ADDR_I2CDATA, d, Validate=False)
+ self.oa.sendMessage(CODE_WRITE, self.ADDR_I2CDATA, d, Validate=False)
d = bytearray([0x00, 0x69, 0x80 | regaddr])
- self.oa.sendMessage(CODE_WRITE, ADDR_I2CSTATUS, d, Validate=False)
+ self.oa.sendMessage(CODE_WRITE, self.ADDR_I2CSTATUS, d, Validate=False)
time.sleep(0.005)
d = bytearray([0x04, 0x69, 0x80 | regaddr])
- self.oa.sendMessage(CODE_WRITE, ADDR_I2CSTATUS, d, Validate=False)
+ self.oa.sendMessage(CODE_WRITE, self.ADDR_I2CSTATUS, d, Validate=False)
time.sleep(0.005)
d = bytearray([0x00, 0x69, 0x80 | regaddr])
- self.oa.sendMessage(CODE_WRITE, ADDR_I2CSTATUS, d, Validate=False)
+ self.oa.sendMessage(CODE_WRITE, self.ADDR_I2CSTATUS, d, Validate=False)
time.sleep(0.005)
- stat = self.oa.sendMessage(CODE_READ, ADDR_I2CSTATUS, Validate=False, maxResp=3)
+ stat = self.oa.sendMessage(CODE_READ, self.ADDR_I2CSTATUS, Validate=False, maxResp=3)
if stat[0] & 0x01:
raise IOError("No ACK from Slave in I2C")
diff --git a/software/chipwhisperer/capture/scopes/cwhardware/ChipWhispererFWLoader.py b/software/chipwhisperer/capture/scopes/cwhardware/ChipWhispererFWLoader.py
index 43dfaf7ce2..f686c39c6b 100644
--- a/software/chipwhisperer/capture/scopes/cwhardware/ChipWhispererFWLoader.py
+++ b/software/chipwhisperer/capture/scopes/cwhardware/ChipWhispererFWLoader.py
@@ -109,8 +109,8 @@ def setFPGAMode(self, release_mode):
"""
Selects where configuration data comes from:
* 'builtin' uses data from python release.
- * 'zipfile' uses seperate zip-file with everything
- * 'debug' expects a seperate .bit file
+ * 'zipfile' uses separate zip-file with everything
+ * 'debug' expects a separate .bit file
"""
if (release_mode != "builtin") and (release_mode != "debug") and (release_mode != "zipfile"):
diff --git a/software/chipwhisperer/capture/scopes/cwhardware/ChipWhispererGlitch.py b/software/chipwhisperer/capture/scopes/cwhardware/ChipWhispererGlitch.py
index d5dd5d59ac..ef1b3a857c 100644
--- a/software/chipwhisperer/capture/scopes/cwhardware/ChipWhispererGlitch.py
+++ b/software/chipwhisperer/capture/scopes/cwhardware/ChipWhispererGlitch.py
@@ -215,7 +215,7 @@ def phase_shift_steps(self) -> int:
"""
if not self._is_husky:
- raise ValueError("For CW-Husky only.")
+ raise ValueError("For CWHusky only.")
return self.cwg.getPhaseShiftSteps()
@@ -228,13 +228,13 @@ def enabled(self) -> bool:
"""
if not self._is_husky:
- raise ValueError("For CW-Husky only.")
+ raise ValueError("For CWHusky only.")
return self.cwg.getEnabled()
@enabled.setter
def enabled(self, enable : bool):
if not self._is_husky:
- raise ValueError("For CW-Husky only.")
+ raise ValueError("For CWHusky only.")
self.cwg.setEnabled(enable)
@@ -248,7 +248,7 @@ def mmcm_locked(self):
@property
def num_glitches(self) -> int:
- """The number of glitch events to generate. CW-Husky only.
+ """The number of glitch events to generate. CWHusky only.
Each glitch event uses the same offset and width settings.
Glitch event x uses repeat[x] and ext_offset[x].
@@ -262,45 +262,45 @@ def num_glitches(self) -> int:
ValueError: number outside of [1, 32].
"""
if not self._is_husky:
- raise ValueError("For CW-Husky only.")
+ raise ValueError("For CWHusky only.")
return self.cwg.getNumGlitches()
@num_glitches.setter
def num_glitches(self, num : int):
if not self._is_husky:
- raise ValueError("For CW-Husky only.")
+ raise ValueError("For CWHusky only.")
self.cwg.setNumGlitches(num)
@property
def actual_num_glitches(self):
"""The number of glitches that were generated during the previous
glitch event (should equal scope.glitch.num_glitches; for debugging).
- CW-Husky only.
+ CWHusky only.
"""
if not self._is_husky:
- raise ValueError("For CW-Husky only.")
+ raise ValueError("For CWHusky only.")
return self.cwg.getNumActualGlitches()
@property
def state(self):
- """Glitch FSM state. CW-Husky only. For debug.
+ """Glitch FSM state. CWHusky only. For debug.
Writing any value resets the FSM to its idle state.
"""
if not self._is_husky:
- raise ValueError("For CW-Husky only.")
+ raise ValueError("For CWHusky only.")
return self.cwg.getState()
@state.setter
def state(self, ignored):
if not self._is_husky:
- raise ValueError("For CW-Husky only.")
+ raise ValueError("For CWHusky only.")
self.cwg.resetState()
@property
def width(self) -> Union[float, int]:
"""The width of a single glitch pulse.
- For CW-Husky, width is expressed as the number of phase shift steps.
+ For CWHusky, width is expressed as the number of phase shift steps.
Minimum width is obtained at 0. Maximum width is obtained at
scope.glitch.phase_shift_steps/2. Negative values are allowed, but -x
is equivalent to scope.glitch.phase_shift_steps-x. The setting rolls
@@ -308,7 +308,7 @@ def width(self) -> Union[float, int]:
notebook in jupyter/demos/husky_glitch.ipynb to visualize glitch
settings.
- For other capture hardware (CW-lite, CW-pro), width is expressed as a
+ For other capture hardware (CWLite, CWPro), width is expressed as a
percentage of one period. One pulse can range from -49.8% to roughly
49.8% of a period. The system may not be reliable at 0%. Note that
negative widths are allowed; these act as if they are positive widths
@@ -317,12 +317,12 @@ def width(self) -> Union[float, int]:
:Getter: Return an int (Husky) or float (others) with the current
glitch width.
- :Setter: Update the glitch pulse width. For CW-lite/pro, the value is
+ :Setter: Update the glitch pulse width. For CWLite/Pro, the value is
adjusted to the closest possible glitch width.
Raises:
UserWarning: Width outside of [-49.8, 49.8]. The value is rounded
- to one of these. (CW-lite/pro only)
+ to one of these. (CWLite/Pro only)
"""
return self.cwg.getGlitchWidth()
@@ -366,7 +366,7 @@ def width_fine(self, value : int):
def offset(self) -> Union[float, int]:
"""The offset from a rising clock edge to a glitch pulse rising edge.
- For CW-Husky, offset is expressed as the number of phase shift steps.
+ For CWHusky, offset is expressed as the number of phase shift steps.
Minimum offset is obtained at 0 (rising edge of glitch aligned with
rising edge of glitch source clock). At
scope.glitch.phase_shift_steps/2, the glitch rising edge is aligned
@@ -376,23 +376,23 @@ def offset(self) -> Union[float, int]:
scope.glitch.phase_shift_steps+x). Run the notebook in
jupyter/demos/husky_glitch.ipynb to visualize glitch settings.
- For other capture hardware (CW-lite, CW-pro), offset is expressed
+ For other capture hardware (CWLite, CWPro), offset is expressed
as a percentage of one period.
A pulse may begin anywhere from -49.8% to 49.8% away from a rising
edge, allowing glitches to be swept over the entire clock cycle.
.. warning:: very large negative offset <-45 may result in double glitches
- (CW-lite/pro only).
+ (CWLite/Pro only).
- :Getter: Return an int (Husky) or float (CW-lite/pro) with the current
+ :Getter: Return an int (Husky) or float (CWLite/Pro) with the current
glitch offset.
- :Setter: Set the glitch offset. For CW-lite/pro, the new value is
+ :Setter: Set the glitch offset. For CWLite/Pro, the new value is
rounded to the nearest possible offset.
Raises:
UserWarning: value outside range [-50, 50] (value is rounded)
- (CW-lite/pro only)
+ (CWLite/Pro only)
"""
return self.cwg.getGlitchOffset()
@@ -453,7 +453,7 @@ def trigger_src(self) -> str:
emitted each time the trigger condition is satisfied, whether or
not the scope is armed.
- .. warning:: calling :code:`scope.arm()` in manual gitch mode will cause a glitch to trigger.
+ .. warning:: calling :code:`scope.arm()` in manual glitch mode will cause a glitch to trigger.
:Getter: Return the current trigger source.
@@ -529,13 +529,13 @@ def ext_offset(self) -> Union[int, list]:
be inserted at a precise moment during the target's execution to glitch
specific instructions.
- For CW-Husky when scope.glitch.num_glitches > 1, this parameter is a
+ For CWHusky when scope.glitch.num_glitches > 1, this parameter is a
list with scope.glitch.num_glitches elements, each element
representing the ext_offset value for the corresponding glitch,
relative to the previous glitch. If ext_offset[i] = j, glitch i will
be issued 2+j cycles after the start of glitch i-1.
- For CW-Lite/Pro, scope.glitch.num_glitches is not supported so this is
+ For CWLite/Pro, scope.glitch.num_glitches is not supported so this is
a simply an integer.
Has no effect when trigger_src = 'manual' or 'continuous'.
@@ -546,12 +546,12 @@ def ext_offset(self) -> Union[int, list]:
This offset must be in the range [0, 2**32).
- :Getter: Return the current external trigger offset(s). For CW-lite/pro
+ :Getter: Return the current external trigger offset(s). For CWLite/Pro
or when num_glitches=1, this is an integer (for backwards
compatibility). Otherwise, it is a MultiGlitchList, which behaves as a list,
but allows ext_offset[x] = y to set settings for glitch x.
- :Setter: Set the external trigger offset(s). Integer for CW-lite/pro,
+ :Setter: Set the external trigger offset(s). Integer for CWLite/Pro,
list of integers for Husky.
Raises:
@@ -573,25 +573,25 @@ def repeat(self) -> Union[int, list]:
the glitch module to produce stronger glitches (especially during
voltage glitching).
- For CW-Husky when scope.glitch.num_glitches > 1, this parameter is a
+ For CWHusky when scope.glitch.num_glitches > 1, this parameter is a
list with scope.glitch.num_glitches elements, each element
representing the repeat value for the corresponding glitch. The
maximum legal value for repeat[i] is ext_offset[i+1]+1. If an
illegal value is specified, the glitch output may be held high for
up to 8192 cycles.
- For CW-Lite/Pro, scope.glitch.num_glitches is not supported so this is
+ For CWLite/Pro, scope.glitch.num_glitches is not supported so this is
a simply an integer.
Has no effect when trigger_src = 'continuous'.
Repeat counter must be in the range [1, 8192].
- :Getter: Return the current repeat value. For CW-lite/pro or when
+ :Getter: Return the current repeat value. For CWLite/Pro or when
num_glitches=1, this is an integer (for backwards compatibility).
Otherwise, it is a list of integers.
- :Setter: Set the repeat counter. Integer for CW-lite/pro, list of
+ :Setter: Set the repeat counter. Integer for CWLite/Pro, list of
integers for Husky.
Raises:
@@ -642,8 +642,8 @@ def output(self, value : str):
class ChipWhispererGlitch(object):
"""
- Drives the Glitch Module inside the ChipWhisperer Capture Hardware Rev2, or can be used to drive this FPGA
- module inserted into other systems.
+ Drives the Glitch Module inside the ChipWhisperer Capture Hardware Rev2, or can be used to drive this FPGA
+ module inserted into other systems.
"""
CLKSOURCE0_BIT = 0b00000000
CLKSOURCE1_BIT = 0b00000001
@@ -829,7 +829,7 @@ def updateGlitchReadBack(self, test=False):
def getPhaseShiftSteps(self):
"""Husky only. Returns number of phase shift steps in one target pll
cycle. This is simply 56 times the pll glitch MMCM's multiplier,
- indepedent of the target clock frequency. (ref: Xilinx UG472 v1.14,
+ independent of the target clock frequency. (ref: Xilinx UG472 v1.14,
"Dynamic Phase Shift Interface in the MMCM")
"""
return self.pll._mmcm_muldiv * 56
@@ -1170,7 +1170,7 @@ def getRepeat(self):
def setGlitchTrigger(self, trigger):
- """Set glitch trigger type (manual, continous, adc-trigger)"""
+ """Set glitch trigger type (manual, continuous, adc-trigger)"""
resp = self.oa.sendMessage(CODE_READ, "CLOCKGLITCH_SETTINGS", Validate=False, maxResp=8)
resp[5] = (resp[5] & ~(0x0C)) | (trigger << 2)
self.oa.sendMessage(CODE_WRITE, "CLOCKGLITCH_SETTINGS", resp, Validate=False)
diff --git a/software/chipwhisperer/capture/scopes/cwhardware/ChipWhispererHuskyClock.py b/software/chipwhisperer/capture/scopes/cwhardware/ChipWhispererHuskyClock.py
index 888f29a496..b3edb8f238 100644
--- a/software/chipwhisperer/capture/scopes/cwhardware/ChipWhispererHuskyClock.py
+++ b/software/chipwhisperer/capture/scopes/cwhardware/ChipWhispererHuskyClock.py
@@ -582,16 +582,16 @@ def set_outfreqs(self, input_freq, target_freq, adc_mul, force_recalc=False):
# input to the PLL between 1MHz and 100MHz
if self._allow_rdiv:
# can lead to phase variability so disabled by default
- scope_logger.warning('scope.clock.pll._allow_rdiv is True; this can cause an inconsistant phase relationship between the target and sampling clocks. Do you really want this?')
+ scope_logger.warning('scope.clock.pll._allow_rdiv is True; this can cause an inconsistent phase relationship between the target and sampling clocks. Do you really want this?')
okay_in_divs = list(range(1,256))
okay_in_divs.append(0.5)
elif input_freq > self._max_pfd:
# in this case we *need* to divide (but we don't need the x2 option)
- scope_logger.warning('input frequency > 100 MHz requires input divider to be used; this can cause an inconsistant phase relationship between the target and sampling clocks.')
+ scope_logger.warning('input frequency > 100 MHz requires input divider to be used; this can cause an inconsistent phase relationship between the target and sampling clocks.')
okay_in_divs = list(range(1,256))
# TODO: uncomment if support is added for frequencies < 1 MHz
#elif input_freq < self._min_pfd:
- # scope_logger.warning('input frequency < 1 MHz requires input divider to be used; this can cause an inconsistant phase relationship between the target and sampling clocks.')
+ # scope_logger.warning('input frequency < 1 MHz requires input divider to be used; this can cause an inconsistent phase relationship between the target and sampling clocks.')
# okay_in_divs = [0.5]
else:
okay_in_divs = [1]
@@ -667,7 +667,7 @@ def set_outfreqs(self, input_freq, target_freq, adc_mul, force_recalc=False):
with a different adc_mul.
It may also be possible to get closer to the requested
frequency if you set scope.clock.pll._allow_rdiv to True;
- however this can result in an inconsistant clock phase between
+ however this can result in an inconsistent clock phase between
the target and ADC clocks; use at your own risk!
""" % (target_freq, best_real_target_freq))
@@ -722,7 +722,7 @@ def _warning_freq(self):
@property
def f_pfd(self):
- """ PFD freqency, using the input frequency against which PLL
+ """ PFD frequency, using the input frequency against which PLL
parameters were calculated.
"""
pfd = self.input_freq/self.get_input_div()
@@ -732,7 +732,7 @@ def f_pfd(self):
@property
def f_vco(self):
- """ VCO freqency, using the input frequency against which PLL
+ """ VCO frequency, using the input frequency against which PLL
parameters were calculated.
"""
vco = self.f_pfd * self.get_fb_prescale() * self.get_pll_mul()
@@ -742,21 +742,21 @@ def f_vco(self):
@property
def f_out(self):
- """ Target freqency, using the input frequency against which PLL
+ """ Target frequency, using the input frequency against which PLL
parameters were calculated.
"""
return self.f_vco / self.get_prescale() / self.get_outdiv(1)
@property
def f_out_adc(self):
- """ ADC freqency, using the input frequency against which PLL
+ """ ADC frequency, using the input frequency against which PLL
parameters were calculated.
"""
return self.f_vco / self.get_prescale() / self.get_outdiv(3)
@property
def f_out_error(self):
- """ Difference between target freqency and requested target frequency,
+ """ Difference between target frequency and requested target frequency,
using the input frequency against which PLL parameters were calculated.
"""
return abs(self.f_out - self._given_target_freq)
@@ -1603,7 +1603,7 @@ def __str__(self):
@property
def adc_src(self):
"""Convenience function for backwards compatibility with how ADC clocks
- are set on CW-lite and CW-pro.
+ are set on CWLite and CWPro.
The ADC can be clocked by one of five possible sources:
@@ -1625,7 +1625,7 @@ def adc_src(self):
@adc_src.setter
def adc_src(self, src):
- scope_logger.warning("scope.clock.adc_src is provided for backwards compability, but scope.clock.clkgen_src and scope.clock.adc_mul should be used for Husky.")
+ scope_logger.warning("scope.clock.adc_src is provided for backwards compatibility, but scope.clock.clkgen_src and scope.clock.adc_mul should be used for Husky.")
self._cached_adc_freq = None
if src == "clkgen_x4":
@@ -1649,7 +1649,7 @@ def adc_src(self, src):
@clear_adc_unlock # type: ignore
def reset_adc(self):
"""Convenience function for backwards compatibility with how ADC clocks
- are managed on CW-lite and CW-pro.
+ are managed on CWLite and CWPro.
"""
self._cached_adc_freq = None
self.pll.reset()
@@ -1664,7 +1664,7 @@ def recal_pll(self):
@property
def adc_locked(self):
"""Convenience function for backwards compatibility with how ADC clocks
- are managed on CW-lite and CW-pro.
+ are managed on CWLite and CWPro.
"""
return self.pll.pll_locked
diff --git a/software/chipwhisperer/capture/scopes/cwhardware/ChipWhispererHuskyMisc.py b/software/chipwhisperer/capture/scopes/cwhardware/ChipWhispererHuskyMisc.py
index 03c4d8258f..0eecdafe68 100644
--- a/software/chipwhisperer/capture/scopes/cwhardware/ChipWhispererHuskyMisc.py
+++ b/software/chipwhisperer/capture/scopes/cwhardware/ChipWhispererHuskyMisc.py
@@ -255,7 +255,7 @@ def setting(self):
In all cases, blinking red lights indicate a temperature, voltage, or
sampling error (see scope.XADC.status and scope.adc.errors for details),
- whlie blinking green and blue lights indicate that a frequency change
+ while blinking green and blue lights indicate that a frequency change
was detected on the external clock input (and that scope.clock should
be updated to account for this).
@@ -779,13 +779,13 @@ def errors(self):
@property
def temp(self):
- """Returns the current FPGA temperature (in celcius).
+ """Returns the current FPGA temperature (in celsius).
"""
return self._get_temp(0)
@property
def max_temp(self):
- """Returns the highest observed FPGA temperature (in celcius) since last power-up
+ """Returns the highest observed FPGA temperature (in celsius) since last power-up
or :class:`user_reset()` call.
"""
return self._get_temp(32)
@@ -841,7 +841,7 @@ def _get_temp(self, addr=0):
addr (int): DRP address (0: current; 32: max; 36: min)
Returns:
- Temperature in celcius (float).
+ Temperature in celsius (float).
"""
raw = self.drp.read(addr)
return (raw>>4) * 503.975/4096 - 273.15 # ref: UG480
@@ -851,10 +851,10 @@ def set_temp(self, temp, addr=0):
Args:
addr (int): DRP address
- temp (float): temperature threshold [celcius]
+ temp (float): temperature threshold [celsius]
Returns:
- Temperature in celcius (float).
+ Temperature in celsius (float).
"""
raw = (int((temp + 273.15)*4096/503.975) << 4) & 0xffff
self.drp.write(addr, raw)
@@ -1336,7 +1336,7 @@ def trigger_source(self):
* "rising_userio_d[0-7]": a rising edge (0->1) on a USERIO pin
* "falling_userio_d[0-7]": a falling edge (1->0) on a USERIO pin
* "rising_tio[0-3]": a rising edge (0->1) on a tio pin
- * "failling_tio[0-3]": a falling edge (0->1) on a tio pin
+ * "falling_tio[0-3]": a falling edge (0->1) on a tio pin
In addition, capture can be triggered manually, irrespective of the trigger_source
setting, by calling :class:`trigger_now`.
diff --git a/software/chipwhisperer/capture/scopes/cwhardware/ChipWhispererSAD.py b/software/chipwhisperer/capture/scopes/cwhardware/ChipWhispererSAD.py
index bc33dfc295..437555e896 100644
--- a/software/chipwhisperer/capture/scopes/cwhardware/ChipWhispererSAD.py
+++ b/software/chipwhisperer/capture/scopes/cwhardware/ChipWhispererSAD.py
@@ -34,7 +34,7 @@
CODE_WRITE = 0xC0
class ChipWhispererSAD(util.DisableNewAttr):
- """Communicates with the SAD module inside the CW Pro.
+ """Communicates with the SAD module inside the CWPro.
This submodule is only available on the ChipWhisperer1200 Pro.
@@ -228,7 +228,7 @@ def __init__(self, *args, **kwargs):
class HuskySAD(util.DisableNewAttr):
- """Communicates with the SAD module inside CW-Husky.
+ """Communicates with the SAD module inside CWHusky.
Because SAD is by far the largest FPGA module, XADC alarms
(temperature/voltage) shut down the SAD.
@@ -629,7 +629,7 @@ def _writing_allowed(self):
@property
def _ref_fifo_errors(self):
- """Whether internal SAD FIFO errors have occured.
+ """Whether internal SAD FIFO errors have occurred.
0 means no errors;
non-zero: see Verilog source file for definitions.
"""
diff --git a/software/chipwhisperer/capture/scopes/cwhardware/ChipWhispererSAM3Update.py b/software/chipwhisperer/capture/scopes/cwhardware/ChipWhispererSAM3Update.py
index fbe35b2cd3..eef5c7d610 100644
--- a/software/chipwhisperer/capture/scopes/cwhardware/ChipWhispererSAM3Update.py
+++ b/software/chipwhisperer/capture/scopes/cwhardware/ChipWhispererSAM3Update.py
@@ -179,7 +179,7 @@ def auto_program(self, fw_path=None):
if not os.path.exists(fw_path):
raise OSError("File {} does not exist. Firmware has not been erased.".format(fw_path))
if (not self._hw_type) and (not fw_path):
- raise OSError("Unable to detect chipwhisperer hardware type and firmware not specified")
+ raise OSError("Unable to detect ChipWhisperer hardware type and firmware not specified")
before = serial.tools.list_ports.comports()
before = get_at91_ports()
# time.sleep(0.5)
@@ -278,7 +278,7 @@ def program(self, port, fw_path=None, hardware_type=None, bypass_warning=False):
if i > 10:
sam.reset()
sam.ser.close()
- self.logfunc("Upgrade succeded")
+ self.logfunc("Upgrade succeeded")
self.logfunc("Unable to set boot flash, may need to power cycle")
return True
diff --git a/software/chipwhisperer/capture/scopes/cwhardware/PartialReconfiguration.py b/software/chipwhisperer/capture/scopes/cwhardware/PartialReconfiguration.py
index ebdace773e..68986c0159 100644
--- a/software/chipwhisperer/capture/scopes/cwhardware/PartialReconfiguration.py
+++ b/software/chipwhisperer/capture/scopes/cwhardware/PartialReconfiguration.py
@@ -55,7 +55,7 @@ def getPartialBitstream(self, indx):
class PartialReconfigDataMulti:
"""
Handles combining multiple partial reconfiguration files into a single file. Relies heavily on
- modifications not happeneing to the same location.
+ modifications not happening to the same location.
"""
def __init__(self):
self.dataList = []
diff --git a/software/chipwhisperer/capture/scopes/cwnano.py b/software/chipwhisperer/capture/scopes/cwnano.py
index 316527dd38..a94129f0b9 100644
--- a/software/chipwhisperer/capture/scopes/cwnano.py
+++ b/software/chipwhisperer/capture/scopes/cwnano.py
@@ -643,7 +643,7 @@ def reset_clock_phase(self):
self.adc.clk_freq = afreq
def con(self, sn=None, **kwargs):
- """Connects to attached chipwhisperer hardware (Nano)
+ """Connects to attached ChipWhisperer hardware (Nano)
Args:
sn (str): The serial number of the attached device. Does not need to
@@ -739,8 +739,8 @@ def get_last_trace(self, as_int=False):
Floating point values are scaled and shifted to be between -0.5 and 0.5.
- Integer values are raw readings from the ChipWhisperer ADC. The ChipWhisperer-Lite
- has a 10-bit ADC, the Nano has an 8-bit ADC, and the Husky can read either
+ Integer values are raw readings from the ChipWhisperer ADC. The CWLite
+ has a 10-bit ADC, the CWNano has an 8-bit ADC, and the CWHusky can read either
8-bits or 12-bits of ADC data.
Args:
diff --git a/software/chipwhisperer/capture/targets/CW305.py b/software/chipwhisperer/capture/targets/CW305.py
index 7b3f9fc8df..772959a70d 100644
--- a/software/chipwhisperer/capture/targets/CW305.py
+++ b/software/chipwhisperer/capture/targets/CW305.py
@@ -173,7 +173,7 @@ def _dict_repr(self):
rtn['platform'] = self.platform
for prop in self.__dir__():
if 'REG_' in prop:
- if getattr(self, prop): # this some stock registers are delcared as None and may remain so
+ if getattr(self, prop): # this some stock registers are declared as None and may remain so
rtn[prop] = getattr(self, prop)
return rtn
@@ -260,7 +260,7 @@ def crypt_type(self):
""" Returns the value of the target's REG_CRYPT_TYPE register (if it exists).
"""
if self.REG_CRYPT_TYPE is None:
- target_logger.error("target.REG_CRYPT_TYPE unset. Have you given target a verilog defines file?")
+ target_logger.error("target.REG_CRYPT_TYPE unset. Have you given target a Verilog defines file?")
return self.fpga_read(self.REG_CRYPT_TYPE, 1)[0]
@property
@@ -268,7 +268,7 @@ def crypt_rev(self):
""" Returns the value of the target's REG_CRYPT_REV register (if it exists).
"""
if self.REG_CRYPT_REV is None:
- target_logger.error("target.REG_CRYPT_REV unset. Have you given target a verilog defines file?")
+ target_logger.error("target.REG_CRYPT_REV unset. Have you given target a Verilog defines file?")
return self.fpga_read(self.REG_CRYPT_REV, 1)[0]
@property
@@ -607,7 +607,7 @@ def checkEncryptionKey(self, key):
def loadEncryptionKey(self, key):
"""Write encryption key to FPGA."""
if self.REG_CRYPT_KEY is None:
- target_logger.error("target.REG_CRYPT_KEY unset. Have you given target a verilog defines file?")
+ target_logger.error("target.REG_CRYPT_KEY unset. Have you given target a Verilog defines file?")
return
self.key = key
key = key[::-1]
@@ -616,7 +616,7 @@ def loadEncryptionKey(self, key):
def loadInput(self, inputtext):
"""Write input to FPGA."""
if self.REG_CRYPT_TEXTIN is None:
- target_logger.error("target.REG_CRYPT_TEXTIN unset. Have you given target a verilog defines file?")
+ target_logger.error("target.REG_CRYPT_TEXTIN unset. Have you given target a Verilog defines file?")
return
self.input = inputtext
text = inputtext[::-1]
@@ -626,7 +626,7 @@ def is_done(self):
"""Check if FPGA is done."""
if self.check_done:
if (self.REG_CRYPT_GO is None) or (self.REG_USER_LED is None):
- target_logger.error("target.REG_CRYPT_GO or target.REG_USER_LED unset. Have you given target a verilog defines file?")
+ target_logger.error("target.REG_CRYPT_GO or target.REG_USER_LED unset. Have you given target a Verilog defines file?")
return
result = self.fpga_read(self.REG_CRYPT_GO, 1)[0]
if result == 0x01:
@@ -643,7 +643,7 @@ def is_done(self):
def readOutput(self):
"""Read output from FPGA."""
if self.REG_CRYPT_CIPHEROUT is None:
- target_logger.error("target.REG_CRYPT_CIPHEROUT unset. Have you given target a verilog defines file?")
+ target_logger.error("target.REG_CRYPT_CIPHEROUT unset. Have you given target a Verilog defines file?")
return
data = self.fpga_read(self.REG_CRYPT_CIPHEROUT, 16)
data = data[::-1]
@@ -691,7 +691,7 @@ def clksleeptime(self, value):
def go(self):
"""Disable USB clock (if requested), perform encryption, re-enable clock"""
if (self.REG_USER_LED is None):
- target_logger.error("target.REG_USER_LED unset. Have you given target a verilog defines file?")
+ target_logger.error("target.REG_USER_LED unset. Have you given target a Verilog defines file?")
return
if self.platform == 'cw305' and self.clkusbautooff:
self.usb_clk_setenabled(False)
@@ -714,10 +714,10 @@ def go(self):
def simpleserial_read(self, cmd, pay_len, end='\n', timeout=250, ack=True):
"""Read data from target
- Mimics simpleserial protocol of serial based targets
+ Mimics SimpleSerial protocol of serial-based targets
Args:
- cmd (str): Command to ues. Only accepts 'r' for now.
+ cmd (str): Command to use. Only accepts 'r' for now.
pay_len: Unused
end: Unused
timeout: Unused
@@ -736,7 +736,7 @@ def simpleserial_read(self, cmd, pay_len, end='\n', timeout=250, ack=True):
def simpleserial_write(self, cmd, data, end=None):
"""Write data to target.
- Mimics simpleserial protocol of serial based targets.
+ Mimics SimpleSerial protocol of serial-based targets.
Args:
cmd (str): Command to use. Target supports 'p' (write plaintext),
@@ -781,7 +781,7 @@ def batchRun(self,batchsize=1024,random_key=True,random_pt=True,seed=None):
batchsize (int): The number of encryption to run (default 1024).
random_key (bool): True if the key is random (default False).
random_pt (bool): True if the plaintext are random (default True).
- seed (int): random int32 for the PRG.
+ seed (int): random int32 for the PRNG.
"""
if seed is None:
seed = random.randint(0,2**32)
diff --git a/software/chipwhisperer/capture/targets/CW310.py b/software/chipwhisperer/capture/targets/CW310.py
index e65837b60b..fccc6765be 100644
--- a/software/chipwhisperer/capture/targets/CW310.py
+++ b/software/chipwhisperer/capture/targets/CW310.py
@@ -209,7 +209,7 @@ def get_xadc_temp(self, maximum=False):
maximum (bool): if True, return the maximum observed temperature (since last reset);
otherwise, return current measured temperature
Returns:
- Temperature in celcius (float).
+ Temperature in celsius (float).
"""
if maximum:
addr = 0x20
@@ -398,7 +398,7 @@ def usb_set_current(self, pdo_num, current):
status = self.usb_i2c_write(pdo_reg, snk_pdo)
def usb_negotiate_pdo(self):
- """Renegotate the USBC PDOs. Must be done for new PDOs settings to take effect
+ """Renegotiate the USBC PDOs. Must be done for new PDOs settings to take effect
"""
#soft reset
# self._naeusb.sendCtrl(0x43, 0, [0x28, 0x51])
diff --git a/software/chipwhisperer/capture/targets/SimpleSerial.py b/software/chipwhisperer/capture/targets/SimpleSerial.py
index ed79ef6f38..785041d693 100644
--- a/software/chipwhisperer/capture/targets/SimpleSerial.py
+++ b/software/chipwhisperer/capture/targets/SimpleSerial.py
@@ -43,7 +43,7 @@ class SimpleSerial(TargetTemplate, util.DisableNewAttr):
scope = cw.scope()
target = cw.target(scope)
- The target is automatically connected to if the default configuration
+ The target is automatically connected to if the default configuration is
adequate.
A `noflush=True` kwarg may be used to suppress an initial protocol-specific
@@ -245,7 +245,7 @@ def is_done(self):
return True
def get_simpleserial_commands(self, timeout=250, ack=True):
- """Gets available simpleserial commands for target
+ """Gets available SimpleSerial commands for the target
Args:
timeout (int, optional): Value to use for timeouts during initial
@@ -255,7 +255,7 @@ def get_simpleserial_commands(self, timeout=250, ack=True):
True.
Returns:
- List of dics with fields 'cmd' command_byte, 'len' command_length, 'flags' command_flags
+ List of dicts with fields 'cmd' command_byte, 'len' command_length, 'flags' command_flags
"""
self.flush()
self.simpleserial_write('y', bytearray())
@@ -362,18 +362,18 @@ def simpleserial_wait_ack(self, timeout=500):
return ret
def simpleserial_write(self, cmd, num, end='\n', var_len=False):
- """ Writes a simpleserial command to the target over serial.
+ """ Writes a SimpleSerial command to the target over serial.
Writes 'cmd' + ascii(num) + 'end' over serial. Flushes the read and
write buffers before writing.
Args:
- cmd (str): String to start the simpleserial command with. For
+ cmd (str): String to start the SimpleSerial command with. For
'p'.
num (bytearray): Number to write as part of command. For example,
the 16 byte plaintext for the 'p' command. Converted to hex-ascii
before being sent. If set to 'none' is omitted.
- end (str, optional): String to end the simpleserial command with.
+ end (str, optional): String to end the SimpleSerial command with.
Defaults to '\\n'.
var_len (bool, optional): Indicates that this command is variable length.
Must be supported by firmware. Defaults to False.
@@ -406,7 +406,7 @@ def simpleserial_write(self, cmd, num, end='\n', var_len=False):
self._simpleserial_last_sent = cmd
def simpleserial_read(self, cmd, pay_len, end='\n', timeout=250, ack=True):
- r""" Reads a simpleserial command from the target over serial.
+ r""" Reads a SimpleSerial command from the target over serial.
Reads a command starting with with an ASCII encoded bytearray
payload of length exp_len*2 (i.e. exp_len=16 for an AES128 key) and
@@ -476,7 +476,7 @@ def simpleserial_read(self, cmd, pay_len, end='\n', timeout=250, ack=True):
return payload
def simpleserial_read_witherrors(self, cmd, pay_len, end="\n", timeout=250, glitch_timeout=8000, ack=True):
- r""" Reads a simpleserial command from the target over serial, but returns invalid responses.
+ r""" Reads a SimpleSerial command from the target over serial, but returns invalid responses.
Reads a command starting with with an ASCII encoded bytearray
payload of length exp_len*2 (i.e. exp_len=16 for an AES128 key) and
diff --git a/software/chipwhisperer/capture/targets/SimpleSerial2.py b/software/chipwhisperer/capture/targets/SimpleSerial2.py
index 2ac28c75cd..785f10a14a 100644
--- a/software/chipwhisperer/capture/targets/SimpleSerial2.py
+++ b/software/chipwhisperer/capture/targets/SimpleSerial2.py
@@ -77,7 +77,7 @@ class SimpleSerial2(TargetTemplate):
[cmd, subcmd, data_len, data_0, ..., data_n, crc (poly=0x4D)]
- The frame is then consistant overhead byte stuffed (COBS) to remove
+ The frame is then consistent overhead byte stuffed (COBS) to remove
all 0x00 bytes. An 0x00 byte is then appended to the end of the frame.
Uses 230400bps by default.
@@ -151,7 +151,7 @@ def _calc_crc(buf):
crc <<= 1
crc &= 0xFF
except:
- target_logger.error("crc error: {}. Try rebuilding firmware if you only get this error.".format(buf))
+ target_logger.error("CRC error: {}. Try rebuilding firmware if you only get this error.".format(buf))
return crc
@@ -302,7 +302,7 @@ def simpleserial_wait_ack(self, timeout=500):
# TODO: Improve this
def simpleserial_read_witherrors(self, cmd=None, pay_len=None, end='\n',\
timeout=250, glitch_timeout=1000, ack=True):
- r""" Reads a simpleserial command from the target over serial, but returns invalid responses.
+ r""" Reads a SimpleSerial command from the target over serial, but returns invalid responses.
Reads a command starting with with a COBS encoded bytearray
payload of length pay_len (i.e. pay_len=16 for an AES128 key) and
@@ -447,7 +447,7 @@ def simpleserial_read_witherrors(self, cmd=None, pay_len=None, end='\n',\
return {'valid': True, 'payload': bytearray(response[3:-2]), 'full_response': response, 'rv': rv}
def get_simpleserial_commands(self, timeout=250, flush_on_err=None, ack=True):
- """Gets available simpleserial commands for target
+ """Gets available SimpleSerial commands for target
Args:
timeout (int, optional): Value to use for timeouts during initial
@@ -460,7 +460,7 @@ def get_simpleserial_commands(self, timeout=250, flush_on_err=None, ack=True):
True.
Returns:
- List of dics with fields 'cmd' command_byte, 'len' 0x00, 'flags' 0x00
+ List of dicts with fields 'cmd' command_byte, 'len' 0x00, 'flags' 0x00
"""
self.flush()
self.simpleserial_write('w', [])
@@ -486,7 +486,7 @@ def _conv_unstuffed_to_dict(self, packet):
pass
def read_cmd(self, cmd=None, pay_len=None, timeout=250, flush_on_err=None, as_dict=False):
- """Read and decode simpleserial-v2 command. Returns the decoded raw packet, with the
+ """Read and decode SimpleSerial-v2 command. Returns the decoded raw packet, with the
preceding and following null bytes present.
Args:
@@ -828,8 +828,8 @@ class SimpleSerial2_CDC(SimpleSerial2):
target = cw.target(scope, cw.targets.SimpleSerial2_CDC, dev_path='COM5')
- Other than that, usage is mostly the same as regular simpleserial
- V2, except the read timeout is always fixed to 250ms.
+ Other than that, usage is mostly the same as regular SimpleSerialV2,
+ except the read timeout is always fixed to 250ms.
It does offer better performance than the regular SSV2 object
if reading serial data back from the target.
diff --git a/software/chipwhisperer/capture/targets/__init__.py b/software/chipwhisperer/capture/targets/__init__.py
index b477f050bf..1000550396 100644
--- a/software/chipwhisperer/capture/targets/__init__.py
+++ b/software/chipwhisperer/capture/targets/__init__.py
@@ -26,8 +26,8 @@
Package containing all of the target types that the ChipWhisperer API can connect to:
Targets:
-* SimpleSerial - Communication via CW Uart Pins
-* SimpleSerial2 - Communication via CW Uart Pins (updated protocol)
+* SimpleSerial - Communication via CW UART Pins
+* SimpleSerial2 - Communication via CW UART Pins (updated protocol)
* CW305 - USB communication to CW305 (also CW305_ECC, CW305_AES_PIPELINED for extensions for those particular targets)
* CW310 - USB communication to CW310
* CW340 - USB communication to CW340
diff --git a/software/chipwhisperer/capture/trace/TraceWhisperer.py b/software/chipwhisperer/capture/trace/TraceWhisperer.py
index 85e4f46da5..edd1693bd8 100644
--- a/software/chipwhisperer/capture/trace/TraceWhisperer.py
+++ b/software/chipwhisperer/capture/trace/TraceWhisperer.py
@@ -46,15 +46,15 @@ class TraceWhisperer(util.DisableNewAttr):
""" Trace interface object.
- This class contains the public API for the Arm Coresight trace sniffing
+ This class contains the public API for the Arm CoreSight trace sniffing
hardware, which exists on several platforms:
- - CW-Husky
+ - CWHusky
- CW305, as DesignStartTrace
- CW610 (PhyWhisperer)
Connecting depends on the platform:
- (a) CW-Husky case: available as scope.trace, no additional steps needed.
+ (a) CWHusky case: available as scope.trace, no additional steps needed.
(b) CW305 (DesignStart) case:
@@ -453,7 +453,7 @@ def leds(self):
Args:
mode (str): "normal": as labeled (armed/capturing)
- "hearbeat": armed = front-end clock heartbeat; capturing = trace clock heartbeat
+ "heartbeat": armed = front-end clock heartbeat; capturing = trace clock heartbeat
"""
if self.platform == 'CW305':
return 'normal'
@@ -462,7 +462,7 @@ def leds(self):
if raw == 0:
return 'normal'
elif raw == 1:
- return 'hearbeat'
+ return 'heartbeat'
else:
raise ValueError
@@ -576,7 +576,7 @@ def _line_reset(self, addr, num_bytes=8):
def simpleserial_write(self, cmd, data, printresult=False, wait=0.6):
- """Convenience function to send a simpleserial command to the simpleserial target,
+ """Convenience function to send a SimpleSerial command to the SimpleSerial target,
and optionally fetch and print the result.
"""
if self._ss is None:
@@ -742,7 +742,7 @@ def restore_uart(self):
def resync(self):
"""Force trace sniffer to resynchronize (using sync frames that are
- continously emitted on the parallel trace port). Failure could be from
+ continuously emitted on the parallel trace port). Failure could be from
absence of a trace clock, or mis-sampling of trace data due to
setup/hold violations (clock edge too close to data edge).
"""
@@ -797,7 +797,7 @@ def fpga_read(self, addr, readlen=4):
def check_fifo_errors(self, underflow=0, overflow=0):
- """Check whether an underflow or overflow occured on the capture FIFO.
+ """Check whether an underflow or overflow occurred on the capture FIFO.
Args:
underflow (int, optional): expected status, 0 or 1
@@ -892,7 +892,7 @@ def read_capture_data(self):
# then check that no underflows or overflows occurred during capture:
if self.errors:
- tracewhisperer_logger.warning("FIFO errors occured: %s" % self.errors)
+ tracewhisperer_logger.warning("FIFO errors occurred: %s" % self.errors)
while not self.fifo_empty():
data.append(self.fpga_read(self.REG_SNIFF_FIFO_RD, 4)[1:4])
@@ -1112,7 +1112,7 @@ def write_raw_capture(self, raw, filename='raw.bin', presyncs=8):
raw (array): raw trace data as obtained from
get_raw_trace_packets()
filename (string): output file
- presyncs (int): number of long syncronization frames which are
+ presyncs (int): number of long synchronization frames which are
prepended to the collected trace data.
"""
binout = open(filename, "wb")
@@ -1367,7 +1367,7 @@ def swo_clock_freq(self, freq, vcomin=600e6, vcomax=1200e6, threshold=0.01):
self.swo_mmcm.set_sec_div(best[2])
actual = input_freq*best[0]/best[1]/best[2]
if abs(actual-freq)/freq*100 > threshold:
- scope_logger.warning("Coudln't achieve exact desired frequency (%f); setting to %f instead." % (freq, input_freq*best[0]/best[1]/best[2]))
+ scope_logger.warning("Couldn't achieve exact desired frequency (%f); setting to %f instead." % (freq, input_freq*best[0]/best[1]/best[2]))
time.sleep(0.1)
if freq > self._warning_frequency:
scope_logger.warning("""
@@ -1513,8 +1513,8 @@ def trace_clock_shift_locked(self):
@property
def trace_clock_shift_range(self):
- """Returns number of phase shift steps in one trace pll cycle. This
- is simply 56 times the MMCM's multiplier, indepedent of the trace
+ """Returns number of phase shift steps in one trace PLL cycle. This
+ is simply 56 times the MMCM's multiplier, independent of the trace
clock frequency. (ref: Xilinx UG472 v1.14, "Dynamic Phase Shift
Interface in the MMCM")
The trace clock frequency must be provided via `trace_clock_set_freq()`
@@ -1778,7 +1778,7 @@ def rules_enabled(self):
"""Set which matching rules are enabled.
Args:
- rules (list of ints): turn on the specified rules; others are turned off. example: [0, 5, 7]: turns on rules 0, 5 and 7.
+ rules (list of ints): turn on the specified rules; others are turned off. Example: [0, 5, 7] turns on rules 0, 5 and 7.
"""
raw = self.main.fpga_read(self.main.REG_PATTERN_ENABLE, 1)[0]
rules = []
diff --git a/software/chipwhisperer/common/api/ProjectFormat.py b/software/chipwhisperer/common/api/ProjectFormat.py
index b6413b4585..686033e15c 100644
--- a/software/chipwhisperer/common/api/ProjectFormat.py
+++ b/software/chipwhisperer/common/api/ProjectFormat.py
@@ -453,7 +453,7 @@ def location(self):
'/path/to/the/directory/containing/this/project'
:Getter:
- (str) Returns the file path of the projects parent directory.
+ (str) Returns the file path of the project's parent directory.
.. versionadded:: 5.1
Added **location** attribute to project.
@@ -461,7 +461,7 @@ def location(self):
return os.path.dirname(os.path.abspath(self.get_filename()))
def export(self, file_path, file_type='zip'):
- """Export a chipwhisperer project.
+ """Export a ChipWhisperer project.
Saves project before exporting.
@@ -503,7 +503,7 @@ def export(self, file_path, file_type='zip'):
def close(self, save=True):
"""Closes the project cleanly.
- Saves by default. Then closes all claimed files.
+ Saves by default, then closes all claimed files.
Args:
save (bool): Saves the project before closing.
diff --git a/software/chipwhisperer/common/api/lascar.py b/software/chipwhisperer/common/api/lascar.py
index 210a1c2fde..301a28213a 100644
--- a/software/chipwhisperer/common/api/lascar.py
+++ b/software/chipwhisperer/common/api/lascar.py
@@ -86,7 +86,7 @@ def show_pge(self):
return df.head(255).style.format(self.format_stat).apply(self.color_corr_key, axis=1)
def results(self): #getStatistics
- """CW Interfae Function"""
+ """CW Interface Function"""
self.dt.known_key = self.hlk
return self.dt
diff --git a/software/chipwhisperer/common/results/glitch.py b/software/chipwhisperer/common/results/glitch.py
index c2b3a6287a..a82447713f 100644
--- a/software/chipwhisperer/common/results/glitch.py
+++ b/software/chipwhisperer/common/results/glitch.py
@@ -229,8 +229,8 @@ def glitch_plot(self, plotdots, x_index=0, y_index=1, x_bound=None, y_bound=None
plotdots (dict): Dictionary mapping groups to shapes and colours
x_index (int or str): Which parameter to use for the x-axis.
y_index (int or str): Which parameter to use for the y-axis.
- x_bound (list or None): Boundarys for x-axis in plot
- y_bound (list or None): Boundarys for y-axis in plot
+ x_bound (list or None): Boundaries for x-axis in plot
+ y_bound (list or None): Boundaries for y-axis in plot
buffer_len (int): Size to make the buffer that holds the points.
x_index and y_index can be either the index for the desired parameter in the original
@@ -486,7 +486,7 @@ def __init__(self, groups, parameters):
def clear(self):
'''
- Clears stored statistics in preperation for a new run.
+ Clears stored statistics in preparation for a new run.
'''
self._result_dict = {}
@@ -566,7 +566,7 @@ def calc(self, ignore_params=[]):
Calculate how many glitches had various effects. Return updated stats.
Can ignore parameters, combining their results. For example, with 3 parameters,
- ignoring parmameter 2 will combine the results where parameter 0 and 1 are the same,
+ ignoring parameter 2 will combine the results where parameter 0 and 1 are the same,
but 2 is different.
'''
diff --git a/software/chipwhisperer/common/results/noguiplots.py b/software/chipwhisperer/common/results/noguiplots.py
index 23ec361b95..d723acb08d 100644
--- a/software/chipwhisperer/common/results/noguiplots.py
+++ b/software/chipwhisperer/common/results/noguiplots.py
@@ -31,7 +31,7 @@ def __init__(self, attack_results=None):
self._results = attack_results
def set_results(self, attack_results):
- """ sets results to attack_results
+ """ Sets results to attack_results
"""
self._results = attack_results
@@ -180,7 +180,7 @@ def byte_to_color(idx):
if bnum_it is None:
bnum_it = range(16)
ret = self.pge_vs_trace(bnum_it[0])
- curve = hv.Curve((ret[0],ret[1]), "Traces Used in Calculation", "Partial Guessing Entrop of Byte").options(title="PGE Vs. Traces")
+ curve = hv.Curve((ret[0],ret[1]), "Traces Used in Calculation", "Partial Guessing Entropy of Byte").options(title="PGE Vs. Traces")
for bnum in bnum_it[1:]:
ret = self.pge_vs_trace(bnum)
curve *= hv.Curve((ret[0],ret[1])).opts(color=byte_to_color(bnum)).opts(width=900, height=600)
diff --git a/software/chipwhisperer/common/traces/_base.py b/software/chipwhisperer/common/traces/_base.py
index 926fb4da77..da661e1038 100644
--- a/software/chipwhisperer/common/traces/_base.py
+++ b/software/chipwhisperer/common/traces/_base.py
@@ -180,9 +180,9 @@ def getKnownKey(self, n=0):
def getAuxDataConfig(self, newmodule):
"""
- Get auxilary data section in config file, searches based on both 'modname'
+ Get auxiliary data section in config file, searches based on both 'modname'
and 'uniquedict'. Checks file itself & NOT the local database, since the
- auxilary data is not loaded into database.
+ auxiliary data is not loaded into database.
"""
# Get all section names
diff --git a/software/chipwhisperer/common/traces/_cfgfile.py b/software/chipwhisperer/common/traces/_cfgfile.py
index 41a9e4a06f..92786cc923 100644
--- a/software/chipwhisperer/common/traces/_cfgfile.py
+++ b/software/chipwhisperer/common/traces/_cfgfile.py
@@ -160,13 +160,13 @@ def attrHeaderValues(self):
return lst
def setConfigFilename(self, fname):
- """Set the config filename, WITHOUT syncronizing internal DB to File. Use load or save for this feature."""
+ """Set the config filename, WITHOUT synchronizing internal DB to File. Use load or save for this feature."""
if fname is not None:
fname = os.path.normpath(fname)
self._configfile = fname
def configFilename(self):
- """Get Config Filename"""
+ """Get config filename"""
return self._configfile
def attr(self, attr, moduleName=None):
@@ -239,7 +239,7 @@ def loadTrace(self, configfile=None):
self.syncFile()
def saveTrace(self, configfile = None):
- """Save internal DB to Config File"""
+ """Save internal DB to config file"""
self.config.filename = self._configfile
self.syncFile()
self.config.write()
diff --git a/software/chipwhisperer/common/utils/looper.py b/software/chipwhisperer/common/utils/looper.py
index d7051b15e1..30f950226b 100755
--- a/software/chipwhisperer/common/utils/looper.py
+++ b/software/chipwhisperer/common/utils/looper.py
@@ -105,7 +105,7 @@ class GlitchLoopDefaultVCCGlitch(GlitchLoopGlitchMethod):
"""Base class to provide the functionality for VCC glitching. This does not set default_setup,
use GlitchDefaultTargetDriver to initialize default_setup settings.
- This configures the glitch mosfets each iteration and resets the mosfets immediately after
+ This configures the glitch MOSFETs each iteration and resets the MOSFETs immediately after
capture.
"""
@@ -130,7 +130,7 @@ def post_capture(self, looper, ctx, timedout):
class GlitchLoopDefaultVCCFastGlitch(GlitchLoopDefaultVCCGlitch):
"""Base class meant to implement a constant VCC glitch method. This only configures glitch
- hardware before the loop and only resets the glitch mosfets after each capture iteration.
+ hardware before the loop and only resets the glitch MOSFETs after each capture iteration.
This class can be initialized directly to specify a runtime configuration.
"""
@@ -149,7 +149,7 @@ def pre_arm(self, looper, ctx):
pass
class GlitchLoopDefaultVLowGlitch(GlitchLoopDefaultVCCFastGlitch):
- """Class that statically sets the glitch method to use the low power mosfet only.
+ """Class that statically sets the glitch method to use the low power MOSFET only.
"""
def __init__(self):
@@ -160,7 +160,7 @@ def glitcht(self):
return GPIOSettings.VCC_GLITCHT_LP
class GlitchLoopDefaultVHighGlitch(GlitchLoopDefaultVCCFastGlitch):
- """Class that statically sets the glitch method to use the high power mosfet only.
+ """Class that statically sets the glitch method to use the high power MOSFET only.
"""
def __init__(self):
@@ -171,7 +171,7 @@ def glitcht(self):
return GPIOSettings.VCC_GLITCHT_HP
class GlitchLoopDefaultVBothGlitch(GlitchLoopDefaultVCCFastGlitch):
- """Class that statically sets the glitch method to use both the mosfets.
+ """Class that statically sets the glitch method to use both the MOSFETs.
"""
def __init__(self):
diff --git a/software/chipwhisperer/common/utils/parameter.py b/software/chipwhisperer/common/utils/parameter.py
index a7a2d8862d..1d931af6a8 100644
--- a/software/chipwhisperer/common/utils/parameter.py
+++ b/software/chipwhisperer/common/utils/parameter.py
@@ -35,7 +35,7 @@
class Parameterized(object):
"""
Abstract class that implements basic functionality required by parameterized objects.
- All parameterized objects should have _name overriden in the class. The objects can also override this attribute
+ All parameterized objects should have _name overridden in the class. The objects can also override this attribute
with different names in the case of having two or more instances. The _description is optional.
"""
_name = "None"
@@ -51,7 +51,7 @@ def getParams(self):
return self.params
def findParam(self, nameOrPath):
- """Return the paramenter child with the given name/path."""
+ """Return the parameter child with the given name/path."""
return self.getParams().getChild(nameOrPath)
def getName(self):
@@ -93,9 +93,9 @@ class Parameter(object):
"int", "float" - A value to be selected between a min and max limit
"range", "rangegraph" - An interval and an interval that can be selected using a graph widget (graphwidget option)
"file" - A string type with a file dialog button
- "filelist" - Complex widged with a file list and mangement buttons to add/remove/edit/copy/set active.
- "color" - Opens a color seletion dialog
- "menu" - Hiden widget that inserts a new menu option
+ "filelist" - Complex widget with a file list and management buttons to add/remove/edit/copy/set active.
+ "color" - Opens a color selection dialog
+ "menu" - Hidden widget that inserts a new menu option
Supported Attributes:
"name", "type" - Mandatory attributes
@@ -108,7 +108,7 @@ class Parameter(object):
"linked" - Refreshes (calls set(get)) the values in the given list with other parameters
"default" - Set the initial value (skips initialization when using set/get)
"tip" - Description of the parameter
- "action" - Calls the provided method with the current paramenter as argument when the value is changed
+ "action" - Calls the provided method with the current parameter as argument when the value is changed
"visible" - Show/hides the parameter
"children" - Insert other parameters to be accessed within the current parameter hierarchy
"readonly" - Prevents the user of changing its value (it can be forced though)
@@ -270,7 +270,7 @@ def getValueKey(self):
return self.getKeyFromValue(self.getValue())
def addChildren(self, children):
- """Add a list of children to the current paramenter"""
+ """Add a list of children to the current parameter"""
addedChildren = []
for child in children:
addedChildren.append(Parameter(self, ignoreChildren=True, **child))
@@ -431,7 +431,7 @@ def remove(self):
self.parent.removeChild(self)
def delete(self):
- """Deletes itself (makes the GC job easier removing cicles). WARNING: Can't be called again!!!"""
+ """Deletes itself (makes the GC job easier removing circles). WARNING: Can't be called again!!!"""
self.remove()
for c in self.childs:
c.delete()
@@ -472,7 +472,7 @@ def removeChild(self, child):
self.sigParametersChanged.emit()
def getChild(self, nameOrPath):
- """Return the paramenter child with the given name/path."""
+ """Return the parameter child with the given name/path."""
if isinstance(nameOrPath, list) or isinstance(nameOrPath, tuple):
item = self.keys.get(nameOrPath[0], None)
diff --git a/software/chipwhisperer/common/utils/sad_explorer.py b/software/chipwhisperer/common/utils/sad_explorer.py
index 12f431ff93..322fffacce 100644
--- a/software/chipwhisperer/common/utils/sad_explorer.py
+++ b/software/chipwhisperer/common/utils/sad_explorer.py
@@ -94,7 +94,7 @@ def __init__(self, scope, target, reftrace, refstart, max_segments=1, width=2000
# to indicate which samples are disabled:
self.quads = []
- # intial legend shows what to do:
+ # initial legend shows what to do:
self.legend = self.create_legend()
self.p.add_layout(self.legend)
diff --git a/software/chipwhisperer/common/utils/sad_model.py b/software/chipwhisperer/common/utils/sad_model.py
index 3118496be0..b0bd4f9bb9 100644
--- a/software/chipwhisperer/common/utils/sad_model.py
+++ b/software/chipwhisperer/common/utils/sad_model.py
@@ -91,10 +91,12 @@ def running(self):
def update(self, sample, time, armed_and_ready):
- # returns matched, covered:
- # - matched: True on a SAD counter match
- # - covered: True is sample is covered by a counter *as the first sample of a potential match pattern*
- # - logscore: log SAD score for the overall system, i.e. when it's time for this counter to trigger (or not)
+ """Returns :code:``(matched, covered, logscore)``:
+ - matched: True on a SAD counter match
+ - covered: True is sample is covered by a counter *as the first sample of a potential match pattern*
+ - logscore: log SAD score for the overall system, i.e. when it's time for this counter to trigger (or not)
+ """
+
match = False
covered = True
logscore = None
@@ -323,14 +325,14 @@ def step(self, sample, armed_and_ready, trigger_allowed=True):
self.match_scores.append(c.SAD)
self.match_counters.append(c.idx)
self.triggered = True
- if self.verbose: print("counter %d matched at time %6d with score: %d" % (self.index, c.idx, c.SAD))
+ if self.verbose: print("Counter %d matched at time %6d with score: %d" % (self.index, c.idx, c.SAD))
if not covered:
self.uncovered_samples.append(self.index+1)
try:
self.covered[self.index+1] = 0
except:
pass
- if self.verbose: print("warning: sample %d is not covered" % (self.index+1))
+ if self.verbose: print("Warning: sample %d is not covered" % (self.index+1))
self.index += 1
return matched
diff --git a/software/chipwhisperer/common/utils/tracesource.py b/software/chipwhisperer/common/utils/tracesource.py
index cfe0fbfca5..5e3b71e70d 100644
--- a/software/chipwhisperer/common/utils/tracesource.py
+++ b/software/chipwhisperer/common/utils/tracesource.py
@@ -33,7 +33,7 @@
class TraceSource(object):
"""
It has traces as output
- Keeps a dictionary with all the registered objets and emits a signal when a new one is added
+ Keeps a dictionary with all the registered objects and emits a signal when a new one is added
"""
registeredObjects : Dict[str, object] = {}
registeredObjects["None"] = None
@@ -58,7 +58,7 @@ def offset(self):
return 0
def getSampleRate(self):
- """Return the Sample Rate used to generate the traces"""
+ """Return the sample rate used to generate the traces"""
return 0
def getTextin(self, n):
@@ -141,7 +141,7 @@ def tracesUpdated(self):
pass
def processTraces(self):
- """Process the Traces acording to its current state"""
+ """Process the Traces according to its current state"""
pass
def traceSourcesChanged(self):
diff --git a/software/chipwhisperer/common/utils/util.py b/software/chipwhisperer/common/utils/util.py
index c860a8c3f7..704aedf116 100644
--- a/software/chipwhisperer/common/utils/util.py
+++ b/software/chipwhisperer/common/utils/util.py
@@ -60,11 +60,11 @@ def appendAndForwardErrorMessage(msg, e):
def list2hexstr(data, delim='', prefix=''):
"""
- Convert a list of integers to a hex string, with optional deliminators/prefix
+ Convert a list of integers to a hex string, with optional delimiters/prefix
delim is inserted between each list item
- prefix is inserted infront of each item (including first item)
+ prefix is inserted in front of each item (including first item)
"""
rstr = ["%02x" % t for t in data]
@@ -308,7 +308,7 @@ def value(self):
_consoleBreakRequested = False
class ConsoleBreakException(BaseException):
- """Custom exception class. Raised when pressing ctrl-C in console.
+ """Custom exception class. Raised when pressing CTRL-C in console.
This inherits from BaseException so that the generic "Save project?" window
doesn't catch it.
@@ -474,7 +474,7 @@ def __getattr__(self, item):
class NoneTypeTarget(object):
- """Raises an intelligble error related to target disconnect when any attribute is accessed
+ """Raises an intelligible error related to target disconnect when any attribute is accessed
"""
def __getattr__(self, item):
raise AttributeError('Target has not been connected')
@@ -584,7 +584,7 @@ def get_cw_type(sn=None, idProduct=None, hw_location=None, **kwargs):
elif name == "ChipWhisperer Nano":
return scopes.CWNano
else:
- raise OSError("Got chipwhisperer with unknown name {} (ID = {})".format(name, possible_ids))
+ raise OSError("Got ChipWhisperer with unknown name {} (ID = {})".format(name, possible_ids))
def better_delay(ms):
t = time.perf_counter() + ms / 1000
diff --git a/software/chipwhisperer/hardware/naeusb/bootloader_sam3u.py b/software/chipwhisperer/hardware/naeusb/bootloader_sam3u.py
index ac8eae7046..2b30d28aa1 100644
--- a/software/chipwhisperer/hardware/naeusb/bootloader_sam3u.py
+++ b/software/chipwhisperer/hardware/naeusb/bootloader_sam3u.py
@@ -795,7 +795,7 @@ def getFlashDescriptor(self):
def writePage(self, page):
if (page >= self.pages):
- raise AttributeError("Invalid Page")
+ raise AttributeError("Invalid page")
self.word_copy.set_dst_addr(self.addr + (page * self.size))
if self._onBufferA:
diff --git a/software/chipwhisperer/hardware/naeusb/fpga.py b/software/chipwhisperer/hardware/naeusb/fpga.py
index 994c25e469..1c6bca7e9d 100644
--- a/software/chipwhisperer/hardware/naeusb/fpga.py
+++ b/software/chipwhisperer/hardware/naeusb/fpga.py
@@ -32,7 +32,7 @@
try:
import numpy as np
except:
- naeusb_logger.info("numpy is required for parallel CW340 programming")
+ naeusb_logger.info("Numpy is required for parallel CW340 programming")
np = None # type: ignore
class FPGA(object):
@@ -140,7 +140,7 @@ def _FPGADownloadBitstream(self, fwFileLike, starting_offset=0x7C, ending_clock_
"""
if np is None and bitorder != 0x00:
- raise ValueError("numpy not installed and parallel programming selected. Install numpy or use serial programming")
+ raise ValueError("Numpy not installed and parallel programming selected. Install Numpy or use serial programming")
# reverse bitwise endianness
def reverse_bits(x):
diff --git a/software/chipwhisperer/hardware/naeusb/naeusb.py b/software/chipwhisperer/hardware/naeusb/naeusb.py
index cdd5970071..df5f5c4732 100644
--- a/software/chipwhisperer/hardware/naeusb/naeusb.py
+++ b/software/chipwhisperer/hardware/naeusb/naeusb.py
@@ -246,7 +246,7 @@ def get_enum_by_name(handle, name):
try:
keyhandle_device = winreg.OpenKey(keyhandle, subkey) # type: ignore
except Exception as e:
- naeusb_logger.info("Could not get keyhandle device " + str(e))
+ naeusb_logger.info("Could not get KeyHandle device " + str(e))
return None
i = 0
address = None
@@ -274,7 +274,7 @@ def get_enum_by_name(handle, name):
try:
keyhandle_driver = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Services\\{}\\Enum".format(service)) # type: ignore
except Exception as e:
- naeusb_logger.info("Could not get keyhandle driver " + str(e))
+ naeusb_logger.info("Could not get KeyHandle driver " + str(e))
return None
num_enums = get_enum_by_name(keyhandle_driver, "Count")
if num_enums:
@@ -290,7 +290,7 @@ def get_enum_by_name(handle, name):
try:
keyhandle_sn = winreg.OpenKey(keyhandle_device, sn) # type: ignore
except Exception as e:
- naeusb_logger.debug("Could not get keyhandle sn " + str(e))
+ naeusb_logger.debug("Could not get KeyHandle sn " + str(e))
return None
service = get_enum_by_name(keyhandle_sn, "Service")
@@ -496,10 +496,10 @@ def get_possible_devices(self, idProduct : Optional[List[int]]=None, dictonly :
"""Get list of USB devices that match NewAE vendor ID (0x2b3e) and
optionally a product ID
- Checks VendorID, then makes sure the devices are accessable
+ Checks VendorID, then makes sure the devices are accessible
Args:
idProduct (list of int, optional): If not None, the product ID to match
- sn (string, optional): If not None,
+ sn (string, optional): If not None, the serial number to match
Returns:
List of USBDevice that match Vendor/Product IDs
"""
@@ -547,7 +547,7 @@ def sendCtrl(self, cmd : int, value : int=0, data : bytearray=bytearray()):
bRequest: {:02X}, wValue: {:04X}, wIndex: {:04X}, data: {}".format(0x41, cmd, \
value, 0, data))
if len(data) > NAEUSB_CTRL_IO_MAX:
- naeusb_logger.error("The naeusb fw ctrl buffer is 128 bytes, but len(data) > 128. If you get a pipe error, this is why.")
+ naeusb_logger.error("The NAEUSB fw ctrl buffer is 128 bytes, but len(data) > 128. If you get a pipe error, this is why.")
self.handle.controlWrite(0x41, cmd, value, 0, data, timeout=self._timeout)
#return self.usbdev().ctrl_transfer(0x41, cmd, value, 0, data, timeout=self._timeout)
@@ -557,7 +557,7 @@ def readCtrl(self, cmd : int, value : int=0, dlen : int=0) -> bytearray:
"""
# Vendor-specific, IN, interface control transfer
if dlen > NAEUSB_CTRL_IO_MAX:
- naeusb_logger.error("The naeusb fw ctrl buffer is 128 bytes, but len(data) > 128. If you get a pipe error, this is why.")
+ naeusb_logger.error("The NAEUSB fw ctrl buffer is 128 bytes, but len(data) > 128. If you get a pipe error, this is why.")
response = self.handle.controlRead(0xC1, cmd, value, 0, dlen, timeout=self._timeout)
naeusb_logger.debug("READ_CTRL: bmRequestType: {:02X}, \
bRequest: {:02X}, wValue: {:04X}, wIndex: {:04X}, data_len: {:04X}, response: {}".format(0xC1, cmd, \
@@ -591,7 +591,7 @@ def _bulk_write(self, data, timeout):
def _cmd_ctrl_send_data(self, pload, cmd : int):
"""Sends data over the control-transfer channel and attempts a pipe error fix if an initial
- error occured.
+ error occurred.
"""
try:
self.sendCtrl(cmd, data=pload)
@@ -898,7 +898,7 @@ def cmdWriteMem(self, addr : int, data : bytearray):
def writeBulkEP(self, data : bytearray, timeout = None):
"""
- Write directoly to the bulk endpoint.
+ Write directly to the bulk endpoint.
:param data: Data to be written.
:return:
"""
@@ -918,7 +918,7 @@ def __init__(self, serial, dlen, segment_size, dbuf_temp, timeout_ms=2000, is_hu
dlen: Number of samples to request.
dbuf_temp: Temporary data buffer, must be of size cmdReadStream_bufferSize(dlen) or bad things happen
timeout_ms: Timeout in ms to wait for stream to start, otherwise returns a zero-length buffer
- is_husky: False for CW-Pro, True for CW-Husky
+ is_husky: False for CWPro, True for CWHusky
Returns:
Tuple of (samples_per_block, total_bytes_rx)
"""
@@ -1059,8 +1059,8 @@ def cmdReadStream_getStatus(self) -> Tuple[int, int, int]:
with overflow buffer status. When an overflow occurs the samples left to stream goes to
zero.
samples_left_to_stream is number of samples not yet streamed out of buffer.
- overflow_lcoation is the value of samples_left_to_stream when a buffer overflow occured.
- unknown_overflow is a flag indicating if an overflow occured at an unknown time.
+ overflow_location is the value of samples_left_to_stream when a buffer overflow occurred.
+ unknown_overflow is a flag indicating if an overflow occurred at an unknown time.
Returns:
Tuple indicating (samples_left_to_stream, overflow_location, unknown_overflow)
"""
@@ -1079,7 +1079,7 @@ def cmdReadStream_getStatus(self) -> Tuple[int, int, int]:
def cmdReadStream_size_of_fpgablock(self) -> int:
""" Asks the hardware how many BYTES are read in one go from FPGA, which indicates where the sync
- bytes will be located. These sync bytes must be removed in post-processing. CW-pro only. """
+ bytes will be located. These sync bytes must be removed in post-processing. CWPro only. """
return 4096
def cmdReadStream_bufferSize(self, dlen : int):
diff --git a/software/chipwhisperer/hardware/naeusb/pll_cdce906.py b/software/chipwhisperer/hardware/naeusb/pll_cdce906.py
index a77f6443bf..cb965171d8 100644
--- a/software/chipwhisperer/hardware/naeusb/pll_cdce906.py
+++ b/software/chipwhisperer/hardware/naeusb/pll_cdce906.py
@@ -362,7 +362,7 @@ def pllwrite(self, pllnum, N, M, outdiv):
# Set PLL Mode (high-speed or regular)
fvco = (self.reffreq * float(N)) / float(M)
if fvco < 80E6 or fvco > 300E6:
- raise IOError("Fvco set to $d, out of range" % fvco)
+ raise IOError("FVCO set to %d, out of range" % fvco)
data = self.cdce906read(6)
if pllnum == 0:
diff --git a/software/chipwhisperer/hardware/naeusb/programmer_avr.py b/software/chipwhisperer/hardware/naeusb/programmer_avr.py
index eac2c6a089..e6cb8f4ecb 100644
--- a/software/chipwhisperer/hardware/naeusb/programmer_avr.py
+++ b/software/chipwhisperer/hardware/naeusb/programmer_avr.py
@@ -175,7 +175,7 @@ class AVRISP(object):
ISP_CMD_XPROG = 0x50
ISP_CMD_XPROG_SETMODE = 0x51
- # next 3 are CW-Lite specific, not part of regular protocol
+ # next 3 are CWLite specific, not part of regular protocol
ISP_CMD_GET_STATUS = 0x20
ISP_CMD_SET_RAMBUF = 0x21
ISP_CMD_GET_RAMBUF = 0x22
diff --git a/software/chipwhisperer/hardware/naeusb/programmer_neorv32.py b/software/chipwhisperer/hardware/naeusb/programmer_neorv32.py
index ebc5d201ca..3327f62d31 100644
--- a/software/chipwhisperer/hardware/naeusb/programmer_neorv32.py
+++ b/software/chipwhisperer/hardware/naeusb/programmer_neorv32.py
@@ -35,7 +35,7 @@
import warnings
def gen_app_binary(rom):
- """Replicate image_gen.c from the neorv32 project
+ """Replicate image_gen.c from the NEORV32 project
"""
#
@@ -80,7 +80,7 @@ def func_wrapper(self, *args, **kwargs):
class Neorv32Programmer:
"""
- Class for programming a Neorv32 RISC-V processor, including FPGA loading of ChipWhisperer targets
+ Class for programming a NEORV32 RISC-V processor, including FPGA loading of ChipWhisperer targets
"""
def __init__(self, scope, timeout=200):
@@ -106,7 +106,7 @@ def load_ice40(self, bsfile=None, force_ice40type=None):
fpga.erase_and_init()
if bsfile is None:
- target_logger.info("ice40: Loading prebuilt Neorv32 core.")
+ target_logger.info("ice40: Loading prebuilt NEORV32 core.")
if force_ice40type:
target_logger.info("ice40: Assuming device type is: %s"%force_ice40type)
@@ -150,7 +150,7 @@ def open_port(self, baud=19200):
self.sp = self._cwserial
else:
- raise NotImplementedError("CW-Serial is only supported method (for now)")
+ raise NotImplementedError("CWSerial is only supported method (for now)")
def close_port(self):
if self._old_baud:
@@ -224,7 +224,7 @@ def program(self, romfilename, bsfile=None, check_rom_size=True):
# Log startup message
start_msg = bytes(self.sp.read())
- target_logger.debug(b"Start Message from Bootlader: " + start_msg)
+ target_logger.debug(b"Start Message from bootloader: " + start_msg)
# Check the menu worked
self.do_cmd("h", expected="Available CMDs:\r\n h: Help\r\n r: Restart\r\n u: Upload\r\n")
diff --git a/software/chipwhisperer/hardware/naeusb/programmer_stm32fserial.py b/software/chipwhisperer/hardware/naeusb/programmer_stm32fserial.py
index fac83e4818..11ce5f3ce3 100644
--- a/software/chipwhisperer/hardware/naeusb/programmer_stm32fserial.py
+++ b/software/chipwhisperer/hardware/naeusb/programmer_stm32fserial.py
@@ -144,7 +144,7 @@ def open_port(self, baud=115200):
self.sp = self._cwserial
else:
- raise NotImplementedError("CW-Serial is only supported method (for now)")
+ raise NotImplementedError("CWSerial is only supported method (for now)")
def close_port(self):
if self._old_baud:
@@ -165,7 +165,7 @@ def close_port(self):
@close_on_fail
def find(self, logfunc=print_fun):
- #setup serial port (or CW-serial port?)
+ #setup serial port (or CWSerial port?)
if logfunc is None:
logfunc = print_fun
@@ -292,7 +292,7 @@ def reset(self):
self.scope.io.nrst = 'high'
time.sleep(0.025)
else:
- raise ValueError('requires either scope or api to be set')
+ raise ValueError('Requires either scope or api to be set')
@close_on_fail
def set_boot(self, enter_bootloader):
@@ -300,13 +300,13 @@ def set_boot(self, enter_bootloader):
if self.scope:
self.scope.io.pdic = 'high'
else:
- raise ValueError('requires either scope or api to be set')
+ raise ValueError('Requires either scope or api to be set')
else:
if self.scope:
self.scope.io.pdic = 'low'
else:
- raise ValueError('requires either scope or api to be set')
- target_logger.info("Assuming appropriate BOOT pins set HIGH on STM32F Hardware now")
+ raise ValueError('Requires either scope or api to be set')
+ target_logger.info("Assuming appropriate BOOT pins set HIGH on STM32F hardware now")
@@ -366,7 +366,7 @@ def cmdGeneric(self, cmd):
def cmdGet(self):
if self.cmdGeneric(0x00):
- target_logger.info("*** Get command");
+ target_logger.info("*** Get command")
length, version = self.sp.read(2)
# version = self.sp.read(1)[0]
target_logger.info(" Bootloader version: " + hex(version))
diff --git a/software/chipwhisperer/hardware/naeusb/programmer_targetfpga.py b/software/chipwhisperer/hardware/naeusb/programmer_targetfpga.py
index d1b85ffc6f..7171026098 100644
--- a/software/chipwhisperer/hardware/naeusb/programmer_targetfpga.py
+++ b/software/chipwhisperer/hardware/naeusb/programmer_targetfpga.py
@@ -160,7 +160,7 @@ class CW312T_XC7A35T(XilinxGeneric):
* Assumes done is 'PDID' (default, but R22/R29 can change that to TIO pin instead)
* Assumes program is 'PDIC'
- Note - suggested to set HS2 to 'none' during programming, as seems to cause programming to be less reliable.
+ Note - suggested to set HS2 to None during programming, as seems to cause programming to be less reliable.
Example::
from chipwhisperer.hardware.naeusb.programmer_targetfpga import CW312T_XC7A35T
@@ -192,7 +192,7 @@ class LatticeICE40(FPGASlaveSPI):
Physical connections (ChipWhisperer <-> ICE40)
* SCK/MOSI to SCK/SI (optional - MISO/SO as well)
* nRST to CRST
- * PDIC to CDONE (optional - read not supported on CW-Lite/CW-1200)
+ * PDIC to CDONE (optional - read not supported on CWLite/CW1200)
* PDID to CS
Example::
@@ -219,7 +219,7 @@ def __init__(self, scope):
def erase_and_init(self):
- """Erase the ice40 CRAM and prepare device for slave SPI mode"""
+ """Erase the iCE40 CRAM and prepare device for slave SPI mode"""
#DONE pin is high-z
setattr(self.scope.io, self.cdone, None)
@@ -381,7 +381,7 @@ def readback(self, sck_speed=1E6, device="iCE40UP5K"):
bram_blocksize = [2560, 2560, 1280, 1280, 2560, 2560, 1280, 1280]
bram_shiftamount = [5, 5, 5, 5, 5, 5, 5, 5]
else:
- raise NotImplementedError("Only ice40UP5K supported for readback")
+ raise NotImplementedError("Only iCE40UP5K supported for readback")
#Initial clocks after bitstream loaded
spi.transfer([0xFF]*126, writeonly=True)
@@ -439,7 +439,7 @@ def wait_until_notbusy(self, spi, max_times=5):
raise IOError("Device never indicated ready.")
def check_idcode(self, csname="pdid"):
- """Reads idcode (this is undocumented feature of ICE40 so very beta).
+ """Reads idcode (this is undocumented feature of iCE40 so very beta).
Requires MISO connection (not always required). Only tested with certain
devices, so if this fails try programming anyway.
@@ -472,14 +472,14 @@ def check_idcode(self, csname="pdid"):
full_idcode = spi.transfer([0x0]*13, start=False, stop=False)
# I think this is ID code? No documentation though.
- # Ohter bytes
+ # Other bytes
idcode = full_idcode[12]
#Other data used for finerprinting(? not done by ice)
full_afteridcode = spi.transfer([0x0]*128, start=False)
# ice programmer does the following, shouldn't matter since we are done with
- # the idcoe read by now?
+ # the idcode read by now?
self.wait_until_notbusy(spi)
spi.transfer([0xFF]*2, stop=False, start=False, writeonly=True)
spi.transfer([0x83, 0x00, 0x00, 0x25, 0x00])
diff --git a/software/chipwhisperer/hardware/naeusb/programmer_xmega.py b/software/chipwhisperer/hardware/naeusb/programmer_xmega.py
index 820b44dfe6..0c6a11da7c 100644
--- a/software/chipwhisperer/hardware/naeusb/programmer_xmega.py
+++ b/software/chipwhisperer/hardware/naeusb/programmer_xmega.py
@@ -213,7 +213,7 @@ def erase(self, memtype="chip"):
def autoProgram(self, hexfile, erase=True, verify=True, logfunc=print_fun, waitfunc=None):
- """Helper funciton for GUI, auto-programs XMEGA device while printing messages to different options. Returns true/false."""
+ """Helper function for GUI, auto-programs XMEGA device while printing messages to different options. Returns true/false."""
status = "FAILED"
@@ -232,7 +232,7 @@ def autoProgram(self, hexfile, erase=True, verify=True, logfunc=print_fun, waitf
try:
self.erase()
except IOError:
- if logfunc: logfunc("**chip-erase timeout, erasing application only**")
+ if logfunc: logfunc("**Chip-erase timeout, erasing application only**")
if waitfunc: waitfunc()
self.enablePDI(False)
self.enablePDI(True)
diff --git a/software/chipwhisperer/hardware/naeusb/spi.py b/software/chipwhisperer/hardware/naeusb/spi.py
index 8ba9e1ad33..d39e7252c6 100644
--- a/software/chipwhisperer/hardware/naeusb/spi.py
+++ b/software/chipwhisperer/hardware/naeusb/spi.py
@@ -111,7 +111,7 @@ def disable(self, set_cs_highz=True):
self.set_cs(None)
def transfer(self, data, start=True, stop=True, writeonly=False):
- """Transfers arbitrary amount of data, dropping cs (if `start` is True)
+ """Transfers arbitrary amount of data, dropping CS (if `start` is True)
and raising it after (if `stop` is set)."""
if start:
@@ -171,7 +171,7 @@ def transfer_max64(self, data, writeonly=False):
return readdata
def toggle_sck(self, toggles, mosistate=False):
- """Toggles SCK line an aribtrary number of times (sometimes required for synchronizing states).
+ """Toggles SCK line an arbitrary number of times (sometimes required for synchronizing states).
Does not respect the SCK setting, only uses a fixed SCK value."""
diff --git a/tests/HuskySADStressTest.ipynb b/tests/HuskySADStressTest.ipynb
index 9b7a073034..df0b83cda5 100644
--- a/tests/HuskySADStressTest.ipynb
+++ b/tests/HuskySADStressTest.ipynb
@@ -5,7 +5,7 @@
"id": "783725f0-857b-4ca6-800a-5837766c8ddc",
"metadata": {},
"source": [
- "# CW-Husky SAD Stress Test\n",
+ "# CWHusky SAD Stress Test\n",
"\n",
"Checks that:\n",
"1. The FPGA doesn't overheat when SAD is run continuously at its maximum clock frequency;\n",
@@ -267,7 +267,7 @@
"CHECK_INTERVAL = 60 # check slope every this many seconds\n",
"TEMP_INTERVAL = 0.5 # measure temperature every this many seconds\n",
"MIN_RUN_TIME = 300 # run for at least this many seconds\n",
- "print('Long test running, check plot above, temperature [celcius] as a function of time [seconds] to see the temperature rising... results checked every %d seconds' % CHECK_INTERVAL)\n",
+ "print('Long test running, check plot above, temperature [celsius] as a function of time [seconds] to see the temperature rising... results checked every %d seconds' % CHECK_INTERVAL)\n",
"while True:\n",
" measurements = int(CHECK_INTERVAL/TEMP_INTERVAL)\n",
" for i in range(measurements):\n",
diff --git a/tests/husky_adc_phase_part1.ipynb b/tests/husky_adc_phase_part1.ipynb
index 3715c8b6fd..b3a7989ef1 100644
--- a/tests/husky_adc_phase_part1.ipynb
+++ b/tests/husky_adc_phase_part1.ipynb
@@ -353,7 +353,7 @@
" sbar.update(1)\n",
" continue\n",
" except Exception as e:\n",
- " print('failed to setup: %s' % e)\n",
+ " print('Failed to setup: %s' % e)\n",
" setup_skipped += 1\n",
" continue\n",
" ref_phase, ref_adc, ref_ref = get_clocks(EXTCLK)\n",
@@ -382,13 +382,13 @@
" setup(FREQ, MUL, INPUT_PHASE)\n",
" set_oversamp(OVERSAMP)\n",
" except Exception as e:\n",
- " print('could not re-apply phase in %s: %s' % (test, e))\n",
+ " print('Could not re-apply phase in %s: %s' % (test, e))\n",
" phase_problems += 1\n",
" continue\n",
" new_settings = str(scope.clock.pll)\n",
" new_params = scope.clock.pll.parameters\n",
" if new_params != ref_params:\n",
- " print('changed settings (%s); all_setting size: %d' % (test, len(all_settings)))\n",
+ " print('Changed settings (%s); all_setting size: %d' % (test, len(all_settings)))\n",
" if test == 'test_clock_change':\n",
" change_problems_f += 1\n",
" else:\n",
@@ -460,10 +460,10 @@
" p = s['params']\n",
" muldiv = 1/p[0]*p[1]*p[2]/p[3]/p[4]\n",
" if muldiv != 1:\n",
- " print('looks like issue #499: %d %f' % (i,muldiv))\n",
+ " print('Looks like issue #499: %d %f' % (i,muldiv))\n",
" \n",
" if p[0] != 1 and s['freq'] <= 100e6:\n",
- " print('oops! %d has input divider != 1!' % i)\n",
+ " print('Oops! %d has input divider != 1!' % i)\n",
" input_dividers += 1\n",
" assert input_dividers == 0"
]
@@ -975,7 +975,7 @@
" try:\n",
" INPUT_PHASE = setup(FREQ, MUL, 0) \n",
" except Exception as e:\n",
- " print('failed to setup: %s' % e)\n",
+ " print('Failed to setup: %s' % e)\n",
" setup_skipped += 1\n",
" continue\n",
" in_div, pll_mul, fb_prescale, prescale, out_div1, out_div3 = scope.clock.pll.parameters\n",
diff --git a/tests/husky_adc_phase_part2.ipynb b/tests/husky_adc_phase_part2.ipynb
index 4e6ec4be74..f76de68fb9 100644
--- a/tests/husky_adc_phase_part2.ipynb
+++ b/tests/husky_adc_phase_part2.ipynb
@@ -219,7 +219,7 @@
" # the capture is re-attempted exactly 19 times before it's successful!\n",
" if all(c == 0 for c in adcclock):\n",
" adcclock = 'all zeros'\n",
- " print('could not find delta; ref_edge=%3d, lock status=%s; adcclock=%s; trying again' % (ref_edge, scope.clock.pll.pll_locked, adcclock))\n",
+ " print('Could not find delta; ref_edge=%3d, lock status=%s; adcclock=%s; trying again' % (ref_edge, scope.clock.pll.pll_locked, adcclock))\n",
" assert scope.LA.locked\n",
" assert scope.clock.pll.pll_locked\n",
" time.sleep(0.5)\n",
@@ -320,7 +320,7 @@
" sbar.update(1)\n",
" continue\n",
" except Exception as e:\n",
- " print('failed to setup: %s' % e)\n",
+ " print('Failed to setup: %s' % e)\n",
" setup_skipped += 1\n",
" continue\n",
"\n",
@@ -409,7 +409,7 @@
"id": "63296dee-8c93-4c1e-8f0a-d31afa186e0a",
"metadata": {},
"source": [
- "## replicate a failure:"
+ "## Replicate a failure:"
]
},
{
@@ -499,7 +499,7 @@
"id": "ca3224b8-5350-4bcb-af31-c6258db6924f",
"metadata": {},
"source": [
- "## visualize phase monotonicity:"
+ "## Visualize phase monotonicity:"
]
},
{
diff --git a/tests/simple_serial_demo.py b/tests/simple_serial_demo.py
index 217aebd425..5f03c6d922 100755
--- a/tests/simple_serial_demo.py
+++ b/tests/simple_serial_demo.py
@@ -503,7 +503,7 @@ def post_loop(self, ctx):
finally:
context.dis()
- print('finished')
+ print('Finished')
if looper:
print('Analyzing results...')
range_glitch = context.make_res_range(KEY_GLITCH)
diff --git a/tests/test_batchrun.py b/tests/test_batchrun.py
index 0b525c3f40..98fe3ac92f 100644
--- a/tests/test_batchrun.py
+++ b/tests/test_batchrun.py
@@ -17,7 +17,7 @@
bitstream_path = "../hardware/victims/cw305_artixtarget/fpga/vivado_examples/aes128_verilog/aes128_verilog.runs/impl_35t/cw305_top.bit"
print("####################")
-print("# Programming the target with default bitsteam")
+print("# Programming the target with default bitstream")
print("####################\n")
target = CW305()
target.con(bsfile=bitstream_path, force=False)
diff --git a/tests/test_common.py b/tests/test_common.py
index e21d2a9076..ab412def54 100644
--- a/tests/test_common.py
+++ b/tests/test_common.py
@@ -87,7 +87,7 @@ def check_ramp(raw, testmode, bits_per_sample, samples, segment_cycles, verbose=
if testmode == 'ADCramp':
if segment_cycles > 0 and (samples % 4 or segment_cycles % 4):
- raise ValueError('not supported: for ADC testing, samples and segment_cycles must be a multiple of 4')
+ raise ValueError('Not supported: for ADC testing, samples and segment_cycles must be a multiple of 4')
started = False
for i, byte in enumerate(raw[1:]):
if started:
@@ -120,7 +120,7 @@ def check_ramp(raw, testmode, bits_per_sample, samples, segment_cycles, verbose=
elif testmode == 'ADCalt':
if segment_cycles > 0 or bits_per_sample != 12:
- raise ValueError('not supported')
+ raise ValueError('Not supported')
for i, byte in enumerate(raw[1:]):
if current_count == 0xaaa:
current_count = 0x555
diff --git a/tests/test_husky_dev.py b/tests/test_husky_dev.py
index 62599eec1b..bc46032d27 100644
--- a/tests/test_husky_dev.py
+++ b/tests/test_husky_dev.py
@@ -637,7 +637,7 @@ def test_adc_freq_sweep(fulltest, samples, presamples, freq_start, freq_stop, fr
outfile.flush()
outfile.close()
- assert all_passed, "see %s for details" % outfilename
+ assert all_passed, "See %s for details" % outfilename
scope.sc._fast_fifo_read_enable = True # return to default
diff --git a/tests/test_husky_prod.py b/tests/test_husky_prod.py
index 91cb69cf94..2a6cc4c90a 100644
--- a/tests/test_husky_prod.py
+++ b/tests/test_husky_prod.py
@@ -35,7 +35,7 @@
"""
Args:
- stress: run more iterations of the tests that stess temperature and voltage rails
+ stress: run more iterations of the tests that stress temperature and voltage rails
"""
@@ -286,7 +286,7 @@ def test_internal_ramp(stress, samples, presamples, testmode, clock, fastreads,
scope.arm()
scope.sc.triggerNow()
scope.sc.arm(False)
- assert scope.capture() == False, 'unable to capture (rep %d), highly unusual error' % i
+ assert scope.capture() == False, 'Unable to capture (rep %d), highly unusual error' % i
raw = np.int64(scope.get_last_trace(True))
errors, first_error = check_ramp(raw, testmode, bits, samples, segment_cycles)
assert errors == 0, "%d errors (rep %d); First error: %d; scope.adc.errors: %s" % (errors, i, first_error, scope.adc.errors)
@@ -324,7 +324,7 @@ def test_target_internal_ramp (samples, presamples, testmode, clock, fastreads,
target.flush()
target.write('x\n')
time.sleep(0.2)
- assert target.read() != '', 'unable to communicate with target'
+ assert target.read() != '', 'Unable to communicate with target'
scope.trigger.module = 'basic'
scope.adc.basic_mode = "rising_edge"
@@ -362,7 +362,7 @@ def test_target_internal_ramp (samples, presamples, testmode, clock, fastreads,
scope.errors.clear()
time.sleep(2)
else:
- assert scope.adc.errors == False, 'unexpected ADC errors: %s' % scope.adc.errors
+ assert scope.adc.errors == False, 'Unexpected ADC errors: %s' % scope.adc.errors
if check:
errors, first_error = check_ramp(raw, testmode, bits, samples, segment_cycles)
assert errors == 0, "%d errors in ramp pattern; First error: %d" % (errors, first_error)
diff --git a/tests/test_s6.py b/tests/test_s6.py
index e1ae5e3b07..eba5305c01 100644
--- a/tests/test_s6.py
+++ b/tests/test_s6.py
@@ -9,7 +9,7 @@
"""
USAGE:
- CW-Husky is used to measure and validate the glitch output from a
+ CWHusky is used to measure and validate the glitch output from a
Spartan6-based CW (i.e. Lite or Pro). Connect Husky HS1 to target CW's HS2
(and ground). The target CW drives its glitch clock output on HS2, which
Husky samples to checks that the glitch clock offset and width are within
@@ -27,8 +27,8 @@
print('\n\n\n\n**************************************************************************************')
print('* *')
print('* IMPORTANT NOTE: *')
-print('* This script is intended for basic regression testing of CW-lite/pro glitching *')
-print('* during development. If you are having issues connecting to your CW-lite or target *')
+print('* This script is intended for basic regression testing of CWLite/Pro glitching *')
+print('* during development. If you are having issues connecting to your CWLite or target *')
print('* device, running this script is unlikely to provide you with useful information. *')
print('* Instead, seek assistance on forum.newae.com or discord by providing details of *')
print('* your setup (including the target), and the full error log from your Jupyter *')