diff options
| author | Louis Burda <quent.burda@gmail.com> | 2023-07-25 05:56:08 +0200 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2023-07-25 05:56:08 +0200 |
| commit | 7d73b738a5703d5263a84dcbe3564e2267af6804 (patch) | |
| tree | e386ecb7813d86577b9fc5ef5153785de60d6f51 /tpu.h | |
| parent | 41760436d528552d64122bb0c837f4d8274a0bdd (diff) | |
| download | tis100-7d73b738a5703d5263a84dcbe3564e2267af6804.tar.gz tis100-7d73b738a5703d5263a84dcbe3564e2267af6804.zip | |
Improve parsing, make stdin / stdout port optional
Diffstat (limited to 'tpu.h')
| -rw-r--r-- | tpu.h | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -58,7 +58,7 @@ struct tpu_inst_op { struct tpu_inst { enum tpu_inst_type type; struct tpu_inst_op ops[2]; - uint8_t opcnt; + unsigned opcnt; }; struct tpu_port { @@ -73,7 +73,7 @@ struct tpu_port { struct tpu { enum tpu_status status; - size_t x, y; + int x, y; struct tpu_port ports[4]; int io_port; @@ -90,7 +90,7 @@ struct tpu { }; struct tpu_map_link { - size_t x, y; + int x, y; struct tpu *tpu; struct tpu_map_link *next; }; @@ -119,11 +119,9 @@ struct tpu_inst *tpu_current_inst(struct tpu *tpu); void tpu_init_ports(struct tpu *tpu, struct tpu_map *map); void tpu_update_ports(struct tpu *tpu); bool tpu_set_inst(struct tpu *tpu, uint8_t pc, enum tpu_inst_type inst, - int op1, union tpu_inst_op_val v1, - int op2, union tpu_inst_op_val v2); + unsigned opcnt, struct tpu_inst_op op1, struct tpu_inst_op op2); bool tpu_add_inst(struct tpu *tpu, enum tpu_inst_type inst, - int op1, union tpu_inst_op_val v1, - int op2, union tpu_inst_op_val v2); + unsigned opcnt, struct tpu_inst_op op1, struct tpu_inst_op op2); void tpu_clear_ports(struct tpu *tpu); enum tpu_status tpu_exec_mov(struct tpu *tpu, struct tpu_inst *inst); enum tpu_status tpu_exec(struct tpu *tpu, struct tpu_inst *inst); @@ -132,7 +130,7 @@ enum tpu_status tpu_step(struct tpu *tpu); void tpu_map_init(struct tpu_map *map); void tpu_map_deinit(struct tpu_map *map); void tpu_map_add(struct tpu_map *map, struct tpu *tpu); -struct tpu *tpu_map_get(struct tpu_map *map, size_t x, size_t y); +struct tpu *tpu_map_get(struct tpu_map *map, int x, int y); void tis_init(struct tis *tis); void tis_deinit(struct tis *tis); |
