diff options
Diffstat (limited to 'bindings/sim_cic3_pdm.cc')
-rw-r--r-- | bindings/sim_cic3_pdm.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/bindings/sim_cic3_pdm.cc b/bindings/sim_cic3_pdm.cc index e21010b..0368217 100644 --- a/bindings/sim_cic3_pdm.cc +++ b/bindings/sim_cic3_pdm.cc @@ -5,22 +5,21 @@ #include "Vcic3_pdm.h" #include "verilated.h" - int pdm2pcm_cic3(const uint8_t *pdm, int pdm_length, int16_t *pcm, int pcm_length) { - // FIXME: verify that output buffer is large enough + // FIXME: verify that output buffer is large enough VerilatedContext *cp = new VerilatedContext; Vcic3_pdm *top = new Vcic3_pdm{cp}; - // Start clock off + // Start clock off top->clk = 0; - // Go through all the input data - int pcm_sample = 0; + // Go through all the input data + int pcm_sample = 0; for (int i = 0; i < pdm_length; i++) { @@ -28,9 +27,9 @@ pdm2pcm_cic3(const uint8_t *pdm, int pdm_length, int16_t *pcm, int pcm_length) top->clk = 1; top->eval(); - if (top->pcm_valid) { - pcm[pcm_sample++] = top->pcm_out; - } + if (top->pcm_valid) { + pcm[pcm_sample++] = top->pcm_out; + } top->clk = 0; top->eval(); |