summaryrefslogtreecommitdiff
path: root/bindings/sim_cic3_pdm.cc
diff options
context:
space:
mode:
authorMartin Stensgård <mastensg@mastensg.net>2025-05-14 21:39:03 +0200
committerMartin Stensgård <mastensg@mastensg.net>2025-05-14 21:39:03 +0200
commit115f675c0813e7e86e1944af5bbf5dcd039d79df (patch)
treeb06178bd66c654c89dd175d267704a83424c0e76 /bindings/sim_cic3_pdm.cc
parent391c6a77fa53bab9c4f56a7c8de7dc0ea191cac6 (diff)
bindings: clang-format
Diffstat (limited to 'bindings/sim_cic3_pdm.cc')
-rw-r--r--bindings/sim_cic3_pdm.cc15
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();