diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2025-08-09 17:35:26 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2025-08-09 17:35:26 +0300 |
| commit | 489beadf61d05f40dd4ac40e4e5290502f7ad078 (patch) | |
| tree | 58241d94c3376aae6b081c6fe16288aa0f4d8593 /tests/simple_ideal_alloc/testbench.c | |
| parent | 1853f5d6594bc371e4d8e631c24acd011a620915 (diff) | |
| download | gran-489beadf61d05f40dd4ac40e4e5290502f7ad078.tar.gz gran-489beadf61d05f40dd4ac40e4e5290502f7ad078.zip | |
format
Diffstat (limited to 'tests/simple_ideal_alloc/testbench.c')
| -rw-r--r-- | tests/simple_ideal_alloc/testbench.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/tests/simple_ideal_alloc/testbench.c b/tests/simple_ideal_alloc/testbench.c index 703c2a8..b505c9d 100644 --- a/tests/simple_ideal_alloc/testbench.c +++ b/tests/simple_ideal_alloc/testbench.c @@ -1,11 +1,6 @@ #include <gran/if/alloc.h> #include "testbench.h" -struct reg { - struct packet pkt; - bool busy; -}; - struct tb { struct component component; struct component *dut; @@ -35,7 +30,8 @@ static stat tb_clock(struct tb *tb) switch (tb->state) { case ADD_REGION: { struct alloc_if_new n = {.space = 0, .start = 0, .end = 10}; - struct packet pkt = create_packet(0, ALLOC_IF_NEW, sizeof(n), &n, PACKET_WRITE); + struct packet pkt = create_packet(0, ALLOC_IF_NEW, sizeof(n), + &n, PACKET_WRITE); assert(SEND(tb, tb->dut, pkt) == OK); tb->state = QUERY_EXISTING; break; @@ -49,7 +45,8 @@ static stat tb_clock(struct tb *tb) assert(r->r == ALLOC_IF_OK); struct alloc_if_q q = {.space = 0, .addr = 5}; - struct packet pkt = create_packet(0, ALLOC_IF_Q, sizeof(q), &q, PACKET_WRITE); + struct packet pkt = create_packet(0, ALLOC_IF_Q, sizeof(q), &q, + PACKET_WRITE); assert(SEND(tb, tb->dut, pkt) == OK); tb->state = REMOVE_REGION; tb->in.busy = false; @@ -66,7 +63,8 @@ static stat tb_clock(struct tb *tb) assert(r->end == 10); struct alloc_if_rm rm = {.space = 0, .start = 0, .end = 10}; - struct packet pkt = create_packet(0, ALLOC_IF_RM, sizeof(rm), &rm, PACKET_WRITE); + struct packet pkt = create_packet(0, ALLOC_IF_RM, sizeof(rm), + &rm, PACKET_WRITE); assert(SEND(tb, tb->dut, pkt) == OK); tb->state = QUERY_NONEXISTING; tb->in.busy = false; @@ -81,7 +79,8 @@ static stat tb_clock(struct tb *tb) assert(r->r == ALLOC_IF_OK); struct alloc_if_q q = {.space = 0, .addr = 5}; - struct packet pkt = create_packet(0, ALLOC_IF_Q, sizeof(q), &q, PACKET_WRITE); + struct packet pkt = create_packet(0, ALLOC_IF_Q, sizeof(q), &q, + PACKET_WRITE); assert(SEND(tb, tb->dut, pkt) == OK); tb->state = FINAL; tb->in.busy = false; |
