diff --git a/README.md b/README.md index cff77ea2d2218ca172db0887b7e623fdae6967a5..5871ed41205fdf7e048772e3ad4df763e186e356 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,11 @@ ## Background -This repository contains data and source codes (in the form of Python notebooks) complementary to the article of the same name published in [TCHES 2024](https://ches.iacr.org/2024/)-1. -We recommend the user to read this article [here](https://ujm.hal.science/ujm-04220101v2/document). +This repository contains data and source codes (in the form of Python notebooks) as complementary material to the article of the same name published in [TCHES 2024](https://ches.iacr.org/2024/)-1. +We recommend the user to read the original paper [here](https://ujm.hal.science/ujm-04220101v2/document). -The article presents a new jitter measurement method for the evaluation of TRNGs. -The aim of this repository is to help the user understand our jitter measurement method. +The original article presents a new jitter measurement method aimed at the evaluation of oscillator-based TRNGs. +The aim of this repository is to help the user understand the new jitter measurement method. <details><summary>Paper abstract</summary> @@ -30,18 +30,17 @@ The repository contains two main folders. In the [`/src`](https://src.koda.cnrs.fr/labhc/code4publications/2024-tches-lcpj-measurement-method/-/tree/master/src?ref_type=heads) folder, we offer the user three Python notebooks. We recommend to use them in the following order: -1. [`Error_analysis`](src/Error_analysis.ipynb): This notebook addresses our analysis of the error of our method due to its approximation of the area under the jitter gaussian (see Section 3.2.1 of our [article](https://ujm.hal.science/ujm-04220101v2/document)). +1. [`Error_analysis`](src/Error_analysis.ipynb): This notebook can be used to analyse the error of the method due to its approximation of the area under the Gaussian curve of jitter (see Section 3.2.1 of the original [paper](https://ujm.hal.science/ujm-04220101v2/document)). -2. [`Simulation`](src/Simulation.ipynb): This notebook simulates our jitter measurement method in Python 3. +2. [`Simulation`](src/Simulation.ipynb): This notebook can be used to simulate the new jitter measurement method in Python 3. -3. [`FPGA_measurements`](src/FPGA_measurements.ipynb): This notebook deals with the measurement of the jitter in three different FGPAs using our method. -For that, it treats the data in the `/data` folder. +3. [`FPGA_measurements`](src/FPGA_measurements.ipynb): This notebook can be used to measure the jitter using the new method. As an example, we measure the jitter in three different FGPAs using data stored in the `/data` folder. ### The `/data` folder -This folder can be foud inside the [`data.zip`](https://src.koda.cnrs.fr/labhc/code4publications/2024-tches-lcpj-measurement-method/-/blob/master/data.zip?ref_type=heads) file. -It contains data to implement our jitter measurement method. -Each subfolder contains twenty binary files acquired with three different FPGAs: +This folder can be found inside the [`data.zip`](https://src.koda.cnrs.fr/labhc/code4publications/2024-tches-lcpj-measurement-method/-/blob/master/data.zip?ref_type=heads) file. +It contains experimental data acquired from three different FPGA families. +Each of the following subfolders contain twenty binary files: 1. `/CV` : data acquired with an Intel® Cyclone® V FPGA. @@ -51,7 +50,7 @@ Each subfolder contains twenty binary files acquired with three different FPGAs: #### The binary files -To implement our jitter measurement method, the following circuit must be implemented in hardware: +To implement the new jitter measurement method, the following circuit has to be implemented in hardware: <figure> <img src="figures/principle.png" style="display:block; margin:auto" width="50%"/> @@ -59,10 +58,9 @@ To implement our jitter measurement method, the following circuit must be implem Circuitry of the ERO-TRNG with an additional counter aimed at the jitter measurement.</figcaption> </figure> -For more information on how to implement our method in hardware correclty, refer to Section 4 in our [article](https://ujm.hal.science/ujm-04220101v2/document)). -Only a set of counter values ​​needs to be acquired from that circuit. -When acquiring the files we defined each counter value to use 16 bits of data. -We set the parameters of our method (see Algorithm 1 in our [article](https://ujm.hal.science/ujm-04220101v2/document)) as follows: +For more information on how to implement the jitter measurement circuitry in hardware, refer to Section 4 of the original [article](https://ujm.hal.science/ujm-04220101v2/document)). +Note that only a set of 16-bit counter values ​​needs to be acquired from that circuit. +Next, we set the parameters of the measurement method (see Algorithm 1 in the original [paper](https://ujm.hal.science/ujm-04220101v2/document)) as follows: $N=4\ 096$ @@ -70,16 +68,17 @@ $L=65\ 535$ $k \in \[1;255\]$ -Each file contains a total of $4\ 096(255 - 1 + 1) + 1$ counter values. +Each file contains a total of $N \left( k_{max}-k_{min}+1 \right) + 1 = 4\ 096(255 - 1 + 1) + 1 = 1\,044\,481$ counter values. Let $c_{i,j}$ be the $j$-th acquired counter value from the circuit in Fig. 1 when $k=i$. A binary file contains the counter values ​​ordered as follows: ```math [c_{1,1},\ c_{1,2},\ c_{1,3},\ ...\ c_{1,4\ 096},\ c_{2,1},\ c_{2,2},\ c_{2,3},\ ...\ ...\ c_{255,4\ 096},\ c_{65\ 535,1}] ``` -Please note only one file is needed to obtain more than one jitter measurement. -However, to prove reproductibility of our jitter measurement method, we offer the user twenty binary files acquired one after the other in a 3 minutes interval for each FGPA. -In order to stabilize the temperature of the board and hence the frequency of oscillators, the files were acquired after the ring oscillators in the FPGA runned for 10 minutes. +The last counter value $c_{65\ 535,1}$ is used approximate the ratio $T_0/T_1$ . +Please note that only one file is sufficient to perfom several jitter measurements. +However, to demonstrate reproductibility of the new jitter measurement method, we offer the user twenty binary files acquired one after the other in 3-minute intervals for each FGPA device. +In order to stabilize the temperature of the board and hence the frequency of oscillators, the files were acquired after the ring oscillators in the FPGA have been running for 10 minutes. <details><summary>Repository structure</summary> @@ -102,14 +101,14 @@ In order to stabilize the temperature of the board and hence the frequency of os </details> -## Usage +## Executing the codes -### Use in a single click using Binder +### By a single click using Binder -1. Click [this link](https://mybinder.org/v2/git/https%3A%2F%2Fsrc.koda.cnrs.fr%2Flabhc%2Fcode4publications%2F2024-tches-lcpj-measurement-method/HEAD) or on the Binder snippet on top of this README. -2. A new tab with the laoding Binder icon will appear, wait for a few minutes. Binder can take a long time to load, but this doesn’t mean that Binder will fail to launch. You can always refresh the window if you see the “… is taking longer to load, hang tight!†message. +1. Click [this link](https://mybinder.org/v2/git/https%3A%2F%2Fsrc.koda.cnrs.fr%2Flabhc%2Fcode4publications%2F2024-tches-lcpj-measurement-method/HEAD) or on the Binder snippet available on top of this README. +2. A new tab with the loading Binder icon will appear, wait for a few minutes. Binder can take a long time to load, but this doesn’t mean that Binder will fail to launch. You can always refresh the window if you see the “… is taking longer to load, hang tight!†message. 3. You will see a JupyterLab interface. -4. On the menu from the left, go to the `/src` folder. Click on the notebook you wish to use. +4. On the menu at the left side, go to the `/src` folder. Click on one of the three notebooks you wish to use. <figure> <img src="figures/Binder_Jupyter.png" style="display:block; margin:auto" width="80%"/> @@ -118,7 +117,7 @@ In order to stabilize the temperature of the board and hence the frequency of os 5. Follow the instructions in the notebook. -### Use our projet locally +### By downloading them and running the projet locally 1. Download our project in a PC with Python. For more information on how to install Python click [here](https://wiki.python.org/moin/BeginnersGuide/Download). 2. Make sure that the following Python modules are installed. If they are not, install them using `pip`. For more information on how to install modules with `pip` click [here](https://packaging.python.org/en/latest/tutorials/installing-packages/). @@ -163,10 +162,10 @@ python -m notebook ### Acknowledgements -To Ugo Mureddu for his guidance and advice. +We gratefully acknowledge the help of Dr. Ugo Mureddu in preparation of this article. ## Support -Send an email to any of the authors if you have any problems or questions. +Send an email to one of the authors if you have any problems or questions. <details><summary>Email addresses</summary> @@ -180,7 +179,7 @@ Send an email to any of the authors if you have any problems or questions. ## Links of interest -<details><summary>For information on other jitter measurement methods</summary> +<details><summary>For information regarding other jitter measurement methods</summary> - _Viktor Fischer and David Lubicz. Embedded evaluation of randomness in oscillator based elementary TRNG. In Lejla Batina and Matthew Robshaw, editors, CHES 2014, volume 8731 of LNCS, pages 527–543. Springer, Heidelberg, September 2014_, [link](https://ujm.hal.science/ujm-01010404/document). - _Bohan Yang, Vladimir Rozic, Milos Grujic, Nele Mentens, and Ingrid Verbauwhede. On-chip jitter measurement for true random number generators. In 2017 Asian Hardware Oriented Security and Trust Symposium, AsianHOST 2017, Beijing, China, October 19-20, 2017, pages 91–96. IEEE Computer Society, 2017_, [link](https://lirias.kuleuven.be/bitstream/123456789/630261/2/OCJMFTRNG.pdf). @@ -188,7 +187,7 @@ Send an email to any of the authors if you have any problems or questions. </details> -<details><summary>For the stochastic model of the jitter based eRO-TRNG</summary> +<details><summary>For the stochastic model of the jitter-based eRO-TRNG</summary> - _Mathieu Baudet, David Lubicz, Julien Micolod, and André Tassiaux. On the security of oscillator-based random number generators. Journal of Cryptology, 24(2):398–425, April 2011_, [link](https://eprint.iacr.org/2009/299.pdf). diff --git a/src/Error_analysis.ipynb b/src/Error_analysis.ipynb index 5f7001b036e6ac2448bb80bb0f4243721f043b2f..acae5f4e92dce9835852e7111504763b7d9707bb 100644 --- a/src/Error_analysis.ipynb +++ b/src/Error_analysis.ipynb @@ -17,9 +17,9 @@ "\n", "\n", "# Analysis of the error due to the area approximation\n", - "This notebook reproduces the results in Section 3.2.1. In other words, it sums up our analysis of the measurement error due to the approximation of the area under the jitter gaussian. The notebook reproduces the plots in Fig. 6.\n", + "This notebook reproduces the results presented in Section 3.2.1. In other words, it sums up our analysis of the measurement error due to the approximation of the area under Gaussian curve of the jitter. The notebook reproduces the plots presented in Fig. 6.\n", "\n", - "The user must set the variables under the cell 'Simulation variables' and retreive the limits of $M_k$ in the cell 'Every possible $α_{AB}$'." + "The user must set the variables under the cell 'Simulation variables' and retrieve the limits of $M_k$ in the cell 'Every possible $α_{AB}$'." ] }, { @@ -65,13 +65,13 @@ "metadata": {}, "source": [ "# Simulation variables\n", - "The following variables can be tuned to adjust the acceptable error on the area approximation.\n", + "The following variables can be tuned to adjust the acceptable error of the area approximation.\n", "\n", - "The number of samples $(N)$ is the number of counter values to acquire for a given frequency divisor factor $(k)$. Higher $N$ will reduce the overall error of the measurements for a given interval $r_{max}-r_{min}$ (read the paragraph below). Nevertheless, it will increase the measurement time considerably as the total amount of counter values to acquire is $N(k_{max}-k_{min})$.\n", + "The number of samples $(N)$ is the number of counter values to acquire for a given frequency divisor factor $(k)$. Higher $N$ will reduce the error due to the area approximation for a given interval $r_{max}-r_{min}$ (read the paragraph below). Nevertheless, it can cosiderably increase the measurement time as the total amount of counter values to acquire is $N(k_{max}-k_{min})$.\n", "\n", - "The variables $r_{min}$ and $r_{max}$ define the limits on $Var(C_k)$ that we accept so that a given $k$ could from a $(k_A,k_B)$ couple. A larger interval $r_{max}-r_{min}$ will include more configurations (more distances between the end of the counting interval and the last edge of the oscillator) in our analysis. This means that more couples $(k_A,k_B)$ will be formed and more jitter measurements will be obtained. However, the resulting meauserments will potentially be affected by a bigger error.\n", + "The variables $r_{min}$ and $r_{max}$ define the limits on $Var(C_k)$ that we accept so that a given $k$ could form a $(k_A,k_B)$ couple. A larger interval $r_{max}-r_{min}$ will include more configurations (more distances between the end of the counting interval and the last edge of the oscillator) in our analysis. This means that more couples $(k_A,k_B)$ will be formed and more jitter measurements will be obtained. However, the resulting meauserments can be affected by a bigger error.\n", "\n", - "The desired maximum error $(ɛ)$ denotes the limit on the error due to the area approximation imposed by the user. At the end of this notebook, the user will be able to see graphically if this threshold is significantly surpassed or not given the $N$, $r_{min}$ and $r_{max}$ he/she sets. Accordingly, he/she can calculate the limits on $M_k$ and use them on the other notebooks of this project." + "The desired maximum error $(ɛ)$ denotes the limit of the error due to the area approximation accepted by the user. At the end of this notebook, the user will be able to see graphically if this threshold is significantly surpassed or not depending on the chosen $N$, $r_{min}$ and $r_{max}$. Accordingly, the user can calculate the limits of $M_k$ and use them in the other notebooks of this project." ] }, { @@ -94,9 +94,9 @@ "metadata": {}, "source": [ "# Simulation\n", - "This simulation analyses every possible error made due to approximation of the area under the jitter gaussian. To that aim, the code combines every possible distances $r_{k_{A}}$ and $r_{k_{B}}$ given by $r_{min}$ and $r_{max}$ and calculted the resulting errors.\n", + "This simulation analyses every possible error made due to approximation of the area under the Guassian curve of the jitter. To that aim, the code combines every possible distances $r_{k_{A}}$ and $r_{k_{B}}$ given by $r_{min}$ and $r_{max}$ and calcultes the resulting errors.\n", "\n", - "For every combination of $r_{k_{A}}$ and $r_{k_{B}}$ the error is obtained by calculating the actual area under the gaussian bell and an approximated area that results from the simulation of a counting experience. Throughout the code, we consider a reduced centered normal law since the results are also valid for a general case." + "For every combination of $r_{k_{A}}$ and $r_{k_{B}}$, the error is obtained by calculating the actual area under the Gaussian bell and an approximated area that results from the simulation of a counting experience. Throughout the code, we consider a reduced centered normal law since the results are also valid for a general case." ] }, { @@ -152,10 +152,10 @@ "metadata": {}, "source": [ "# Show results\n", - "## Distribution of the last rising edge of $s_1$ - Top panel of Figure 6\n", - "Here we show the distribution of the last edge of RO1 with respect to end of the counting interval that will be considered for our analysis.\n", + "## Distribution of the last rising edge of $s_1$ - Top panel in Figure 6\n", + "Here we show the distribution of the last edge of RO1 with respect to the end of the counting interval that will be considered in our analysis.\n", "\n", - "The values $r_{k_{A}}$ and $r_{k_{B}}$ outside the intervals given by $r_{min}$ and $r_{max}$ are not plotted because they will be discarded by the limits on $M_k$ given later in this notebook. " + "The values $r_{k_{A}}$ and $r_{k_{B}}$, which are outside the intervals given by $r_{min}$ and $r_{max}$ are not plotted because they will be discarded by the limits of $M_k$ given later in this notebook. " ] }, { @@ -219,10 +219,10 @@ "id": "807d5c74", "metadata": {}, "source": [ - "## Every possible $α_{AB}$ - Bottom panels of Figure 6\n", - "We plot every obtained $α_{AB}$ as a function of $r_{k_{A}}$ in orange and $r_{k_{B}}$ in blue. We also indicate with the horizontal dashed black lines the error limit aimed by the user and set at the beginning of this notebook.\n", + "## Every possible $α_{AB}$ - Bottom panels in Figure 6\n", + "We plot every obtained $α_{AB}$ as a function of $r_{k_{A}}$ in orange and $r_{k_{B}}$ in blue. We also indicate with the horizontal dashed black lines the error limits chosen by the user and set at the beginning of this notebook.\n", "\n", - "The user can decide if the aimed error limit is fairly respected or not. If the user decided it is, we show the limits that should be imposed on $M_k$ to obtained the error $α_{AB}$ plotted here. If the user decided it is not, we suggest how to modify some variables to achieve this after re-running this notebook." + "The user can decide if the accepted error limit is respected or not. If the user decided it is, we show the limits that should be imposed on $M_k$ to obtain the error $α_{AB}$ plotted here. If the user decided it is not, we suggest how to modify some variables to achieve this after re-running this notebook." ] }, { @@ -235,11 +235,11 @@ "name": "stdout", "output_type": "stream", "text": [ - "If you consider that the errors are fairly within the error limits you stablished (horizontal dashed black lines).\n", - "Then, the following conditions must hold :\n", + "If you consider that the errors are fairly within the error limits you established (horizontal dashed black lines).\n", + "Then, the following conditions must be met :\n", "\t 3446\t<= M_kA <= 4002\n", "\t 93\t<= M_kB <= 649\n", - "If you are not statisfied with the result, consider :\n", + "If you are not satisfied with the result, consider :\n", "\t- Increasing N.\n", "\t- Reducing the interval r_max - r_min. We suggest r_max<=3 and r_min>= 0.5.\n", "\t- Increasing the acceptable error.\n" @@ -285,10 +285,10 @@ "upp_MkB=int(N*norm.cdf(-r_min))\n", "low_MkB=int(N*norm.cdf(-r_max))\n", "# Using Eq. (30) to calculate the limits on Mk for the given N, r_min and r_max.\n", - "print(\"If you consider that the errors are fairly within the error limits you stablished (horizontal dashed black lines).\\nThen, the following conditions must hold :\")\n", + "print(\"If you consider that the errors are fairly within the error limits you established (horizontal dashed black lines).\\nThen, the following conditions must be met :\")\n", "print(\"\\t \"+str(low_MkA)+\"\\t<= M_kA <= \"+str(upp_MkA))\n", "print(\"\\t \"+str(low_MkB)+\"\\t<= M_kB <= \"+str(upp_MkB))\n", - "print(\"If you are not statisfied with the result, consider :\")\n", + "print(\"If you are not satisfied with the result, consider :\")\n", "print(\"\\t- Increasing N.\")\n", "print(\"\\t- Reducing the interval r_max - r_min. We suggest r_max<=3 and r_min>= 0.5.\")\n", "print(\"\\t- Increasing the acceptable error.\")" @@ -299,8 +299,8 @@ "id": "fe0005d2", "metadata": {}, "source": [ - "# Optional - 3D visualiation of the bottom plots of Fig. 6\n", - "In the cell above we supperposed the obtained $α_{AB}$ for the different values of $r_{k_{A}}$ and $r_{k_{B}}$. However, we offer an interesing plot that allows the user to observe the distribution of every $α_{AB}$ as a function of both $r_{k_{A}}$ and $r_{k_{B}}$." + "# Optional - 3D visualization of the bottom plots of Fig. 6\n", + "In the cell above we superposed the obtained $α_{AB}$ for the different values of $r_{k_{A}}$ and $r_{k_{B}}$. Also, we offer an interesting plot that allows the user to observe the distribution of every $α_{AB}$ as a function of both $r_{k_{A}}$ and $r_{k_{B}}$." ] }, { diff --git a/src/FPGA_measurements.ipynb b/src/FPGA_measurements.ipynb index 72f95cffe355cbb221c5531e6cd12e95a42b894f..975b02da658a159d8740bd51dd1e29578ad6e652 100644 --- a/src/FPGA_measurements.ipynb +++ b/src/FPGA_measurements.ipynb @@ -17,9 +17,9 @@ "\n", "\n", "# Hardware implementation of the method\n", - "This notebook provides a series of jitter measurements resulting from a set of counter values from an FPGA implementation of the circuit in Fig. 1.\n", + "This notebook provides a series of jitter measurements resulting from a set of counter values obtained from an FPGA device using the circuit presented in Fig. 1.\n", "\n", - "The user should select a FPGA from the three options we offer under the cell 'Data set'. In order to process self acquired data, the first four variables under the cell 'Implementation variables' should be set accordingly. Otherwise, the user only has to set the rest of them according to the results from the notebook Error_Analysis." + "The user should select one of the three FPGA devices available under the cell 'Data set'. In order to process self-acquired data, the first four variables under the cell 'Implementation variables' should be set accordingly. Otherwise, the user only has to set the rest of them according to the results obtained from the notebook Error_Analysis." ] }, { @@ -65,11 +65,11 @@ "metadata": {}, "source": [ "# Data set\n", - "The user can select a data set from 3 different FPGAs (Cyclone V from Intel, Spartan 6 from Xilinx and Smart Fusion 2 from Microchip). Each data set is located in a dedicated folder inside the data folder. Every set is composed of 20 binary files.\n", + "The user can select a data set from three different FPGA devices (Cyclone V from Intel, Spartan 6 from Xilinx and Smart Fusion 2 from Microchip). Each data set is located in a dedicated folder inside the main data folder. Every set is composed of 20 binary files.\n", "\n", - "Each binary file contains $N(k_{max}-k_{min}+1)+1$ acquired counter values. The first $N$ values correspond to $k=k_{min}$, the following $N$ to $k=k_{min}+1$ and so on until $k=k_{max}$. The very last value in the file represents the counter value obtained for $k=L$, it is necessary to approximate the ratio $T_0/T_1$ to $c_L/L$. The ring oscillators were implemented so that $T_0/T_1 < 1$. Hence, we assure that the biggest obtained counter values when $k=L=65535$ can be coded in 16 bits without an overflow of the counter.\n", + "Each binary file contains $N(k_{max}-k_{min}+1)+1$ acquired counter values. The first $N$ values correspond to $k=k_{min}$, the following $N$ to $k=k_{min}+1$ and so on until $k=k_{max}$. The very last value in the file represents the counter value obtained for $k=L$. It is necessary to approximate the ratio $T_0/T_1$ to $c_L/L$. The ring oscillators were implemented so that $T_0/T_1 < 1$. Hence, we assure that the biggest obtained counter values (i.e., when $k=L=65535$) can still be coded in 16 bits, without a counter overflow.\n", "\n", - "Each file represents an experiment where $k$ was varied from $k_{min}=1$ to $k_{max}=255$. The files were generated one after the other in a 8 minutes interval using a FPGA." + "Each file represents an experiment where $k$ varied from $k_{min}=1$ to $k_{max}=255$. The files were generated one after the other in 3-minute intervals, using the measurement circuitry implemented in the selected FPGA device." ] }, { @@ -106,7 +106,7 @@ "source": [ "# Implementation variables\n", "These variables should be changed according to the hardware implementation under study or the desired maximal error bound.\n", - "The current values correspond to the binary files in the original data folders." + "The current values correspond to the binary files available in the original data folders." ] }, { @@ -143,7 +143,7 @@ "metadata": {}, "source": [ "# Data processing\n", - "With the data from the binary files in the selected data folder, this cell implements Algorithm 1 (i.e. our jitter measurement method)." + "This cell implements Algorithm 1 (i.e. the new jitter measurement method) using the data from the binary files in the selected data folder (selected FPGA family)." ] }, { @@ -224,7 +224,7 @@ "metadata": {}, "source": [ "# Print results - Table 3\n", - "Prints an extended version of Table 3. It prints the found $(k_A,k_B)$ couples of the selected files and their consequent jitter measurements. The table also shows the necessary data to recalculate the jitter measurement and the maximal error bound of the measurement, as calculated in Section 3.2." + "This cell prints an extended version of Table 3. It prints the found $(k_A,k_B)$ couples from selected files and their corresponding jitter measurements. The table also shows the necessary data to calculate the jitter measurement using Eq. (22) and the maximal error bound of the measurement, as calculated in Section 3.2." ] }, { @@ -312,7 +312,7 @@ "metadata": {}, "source": [ "## Variance peaks - Figure 4\n", - "Recreates Fig. 4, the condition $0<=Var(C_k)<=0.25$ is always satisfied. This suggests that only two different counter values are found for every evaluated frequency divisor factor. If one compares two different files, one can see that the variance peaks are always found around the same $k$ values. This verifies the repeatability of our results." + "This cell recreates Fig. 4. The condition $0<=Var(C_k)<=0.25$ is always satisfied, suggesting that only two different counter values are found for every evaluated frequency divisor factor. If the user compares two different files, he/she can see that the variance peaks are always found around the same $k$ values. This verifies the repeatability of the obtained results." ] }, { @@ -357,8 +357,8 @@ "id": "b901edfa", "metadata": {}, "source": [ - "## Measurements boxplot - Figure 12\n", - "Recreates the last two boxplots of Fig. 12. One measurements boxplot is obtained directly from every obtained jitter measurement. The second boxplot is obtained after setting a constraint on the maximum values of the frequency divisor factors that form a couple." + "## Measurement boxplots - Figure 12\n", + "Recreates the last two boxplots presented in Fig. 12. One boxplot is obtained directly from every performed jitter measurement. The second boxplot is obtained after setting a constraint on the maximum values of the frequency divisor factors that form a couple." ] }, { diff --git a/src/Simulation.ipynb b/src/Simulation.ipynb index da450ad88753e7e4bd21f4defb224e36ccf80110..215a5242f857444ce3a3fadcae0424d77a537636 100644 --- a/src/Simulation.ipynb +++ b/src/Simulation.ipynb @@ -17,11 +17,11 @@ "\n", "\n", "# Simulation of our jitter measurement method\n", - "This notebook simulates a counting experience for a couple of ring oscillators with given average periods and jitter. We then use this simulation to reproduce Algorithm 1, i. e. our jitter measurement method.\n", + "This notebook simulates a counting experience for a couple of ring oscillators with given average periods and jitter size. We then use this simulation to reproduce Algorithm 1, i. e. the new jitter measurement method.\n", "\n", - "Finally in this notebook, we show the results of the simulation that will help the user understand how our method and its error analysis work. Note that in simulation the user can access all the variables that make the method work, contrarily to a hardware implementation of the method, where one can only measure some variables (see notebook FPGA_measurements).\n", + "Finally in this notebook, we show simulation results that will help the user understand how the jitter measurement method and its error analysis work. Note that in simulation, the user controls every variable of the method. In contrast to a hardware implementation of the method, in which only some variables can be set up (see the notebook FPGA_measurements).\n", "\n", - "The user can modify the variables under the cell 'Simulation constants' at will. The variables under the cell 'Simulation variables' should be set according to the results obtained after running the notebook Error_Analysis." + "The user can modify the variables under the cell 'Simulation constants' at will. The variables under the cell 'Simulation variables' should be set according to the results obtained from the notebook Error_Analysis." ] }, { @@ -67,9 +67,9 @@ "metadata": {}, "source": [ "# Simulated constants\n", - "The following global constants represent the characteristics of a simulated couple of ROs. Normally, the designer cannot control the exact value of each constant as they rest defined for a specific hardware implementation. \n", + "The following global constants represent the characteristics of a simulated couple of ROs. Normally, the designer cannot control the exact value of each constant as they depend on the hardware implementation. \n", "\n", - "A slight change of these constants can drastically change the behaviour of jitter measurement method but NOT its performance. Please, change them at will." + "A slight change of these constants can drastically change the behavior of the jitter measurement method but NOT its performance. Please, change them at will." ] }, { @@ -254,10 +254,10 @@ "metadata": {}, "source": [ "# Show results\n", - "## Potential $k$ candidates - Table 1\n", - "This tables shows the potential $k$ values a that could serve to create a jitter measurement.\n", + "## Possible $k$ candidates - Table 1\n", + "This tables shows the possible $k$ values a that could serve to create a jitter measurement.\n", "\n", - "In other words, for a given $k$ we show the variance of the set $C_k$, the different encountered counter values in $C_k$ and the number of times they appeared where $c_{k,1}$ is the most often encountered counter value and $c_{k,2}$ is the second most often encountered counter value, and the case identified (according to Fig. 5), where A indicates that $c_{k,1} > c_{k,2}$ and B indicates that $c_{k,2} > c_{k,1}$." + "For a given $k$ we show the variance of the set $C_k$, the different encountered $c_k$ in $C_k$ and the number of times they appeared in the set. Where $c_{k,1}$ is the most often encountered counter value and $c_{k,2}$ is the second most often encountered counter value. The last column indicates the identified case, where A indicates that $c_{k,1} > c_{k,2}$ and B indicates that $c_{k,2} > c_{k,1}$." ] }, { @@ -317,9 +317,9 @@ "metadata": {}, "source": [ "## Error analysis of the jitter measurements - Table 2\n", - "This table illustrates the usage of the equations in Section 3.2. From the potential $k$ values in the previous table, this table shows the couples where $|k_A-k_B| <= d$ in the upper part. The lower part (separated by a line of dashes), shows the measurement couples were the condition $|k_A-k_B| <= d$ is not met.\n", + "This table illustrates the usage of equations in Section 3.2. From the possible $k$ values given in the previous table, the upper part of this table shows the couples where $|k_A-k_B| <= d$. The lower part of the table (separated by a dashed line), shows the measurement couples for which the condition $|k_A-k_B| <= d$ is not met.\n", "\n", - "As we know the exact phases of the oscillators at the end of the counting interval in simulations, we can calculate each error component exactly, using Eq. (25) and (26). As we also know the exact value of the jitter, we can calculate the exact error of the measurement (in the last column). Notice that the exact error upper bound (calculated using Eq. (25), (26) and (35)) is always greater than the actual measruement error.\n", + "As in simulation, we know the exact phases of the oscillators at the end of the counting interval, we can calculate each error component precisely, using Eq. (25) and (26). As we also know the exact value of the jitter, we can calculate the exact error of the measurement (presented in the last column). Notice that the upper bound of the error (calculated using Eq. (25), (26) and (35)) is always greater than the actual measruement error.\n", "\n", "Notice how each error component, and consequently the error bound and the actual measurement error increase in the lower part of the table were $|k_A-k_B|$ can be big." ] @@ -375,12 +375,10 @@ "id": "2bdd1135", "metadata": {}, "source": [ - "## Comparison between approximate and exact calculations of the upper error bound\n", - "When we actually apply the jitter measurement method in a hardware device, the phase of the oscillators at the end of the counting interval is unknown. Therefore, the upper error bound can only be approximated using measurable parameters.\n", + "## Comparison of the upper bound of the error obtained by approximate and exact calculations\n", + "When we measure the jitter in hardware, the phase of the oscillators at the end of the counting interval is unknown. Therefore, the upper bound of the error can only be approximated using measurable parameters.\n", "\n", - "Note how using Eq. (34) instead of Eq. (26) for the calculation of $α_{01}$, and approximating $α_{AB}$ instead of using Eq. (25) for its calculation, can greatly increase the upper error bound.\n", - "\n", - "Despite this increase, note how the actual measurement error is always lower than the exact upper error bound, which is at the same time lower than the approximate error bound (see the last three columns)." + "In particular, note how using Eq. (34) instead of Eq. (26) for the calculation of $α_{01}$ and approximating $α_{AB}$ instead of using Eq. (25) can greatly increase the upper bound of the error. Despite this increase, note that the real measurement error is always lower than the exact upper bound of the error, which is at the same time lower than the approximate error bound (see the last three columns)." ] }, {