Added comments

I added a few comments to review what I have to change and what I need to start coding.
This commit is contained in:
NickAA 2023-01-20 15:24:24 -05:00
parent 7ceaa730d9
commit 00ac3e03dc
1 changed files with 4 additions and 0 deletions

View File

@ -7,12 +7,14 @@
#include <random> #include <random>
#include <unistd.h> #include <unistd.h>
// Other classes implemented (Verilator)
#include <verilated.h> #include <verilated.h>
#include "control_loop_math_implementation.h" #include "control_loop_math_implementation.h"
#include "control_loop_cmds.h" #include "control_loop_cmds.h"
#include "Vcontrol_loop_sim_top.h" #include "Vcontrol_loop_sim_top.h"
using ModType = Vcontrol_loop_sim_top; using ModType = Vcontrol_loop_sim_top;
// Clock
uint32_t main_time = 0; uint32_t main_time = 0;
double sc_time_stamp() { double sc_time_stamp() {
return main_time; return main_time;
@ -52,10 +54,12 @@ int main(int argc, char **argv) {
mod->clk = 0; mod->clk = 0;
// Replace CONTROL_LOOP_P with an int P and the number with char or string seed
set_value(0b11010111000010100011110101110000101000111, CONTROL_LOOP_P); set_value(0b11010111000010100011110101110000101000111, CONTROL_LOOP_P);
/* Constant values must be sized to 64 bits, or else the compiler /* Constant values must be sized to 64 bits, or else the compiler
* will think they are 32 bit and silently mess things up * will think they are 32 bit and silently mess things up
*/ */
// Replace CONTROL_LOOP_I with int I
set_value((V)6 << CONSTS_FRAC, CONTROL_LOOP_I); set_value((V)6 << CONSTS_FRAC, CONTROL_LOOP_I);
set_value(20, CONTROL_LOOP_DELAY); set_value(20, CONTROL_LOOP_DELAY);
set_value(10000, CONTROL_LOOP_SETPT); set_value(10000, CONTROL_LOOP_SETPT);