From f66b372bdffea29ecac3172dd49e48783db45dc1 Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Wed, 16 Nov 2022 23:32:00 -0600 Subject: Fix carry flag bug --- conspiracion.qsf | 3 ++- rtl/core/alu/alu.sv | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/conspiracion.qsf b/conspiracion.qsf index a8f62ac..d4e404a 100644 --- a/conspiracion.qsf +++ b/conspiracion.qsf @@ -354,4 +354,5 @@ set_global_assignment -name USE_SIGNALTAP_FILE bus_test.stp set_global_assignment -name SIGNALTAP_FILE bus_test.stp -set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top + +set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top \ No newline at end of file diff --git a/rtl/core/alu/alu.sv b/rtl/core/alu/alu.sv index 1e19338..2f71d6a 100644 --- a/rtl/core/alu/alu.sv +++ b/rtl/core/alu/alu.sv @@ -33,7 +33,7 @@ module core_alu .q(q_sub), .c(c_sub), .v(v_sub), - .c_in(c_in && op `FIELD_ALUOP_SUB_SBC), + .c_in(!c_in && op `FIELD_ALUOP_SUB_SBC), .* ); @@ -44,7 +44,7 @@ module core_alu .q(q_rsb), .c(c_rsb), .v(v_rsb), - .c_in(c_in && op `FIELD_ALUOP_RSB_RSC), + .c_in(!c_in && op `FIELD_ALUOP_RSB_RSC), .* ); -- cgit v1.2.3