jbush001 / NyuziProcessor

GPGPU microprocessor architecture
Apache License 2.0
1.99k stars 351 forks source link

state trace does not properly record writeback conflicts #129

Closed jbush001 closed 6 years ago

jbush001 commented 6 years ago

This only affects the state trace tool. The code to log the current thread state for the tool looks like this:

            always_comb
            begin
                if (!instruction_latched)
                    thread_state[thread_idx] = TS_WAIT_ICACHE;
                else if (thread_blocked[thread_idx])
                    thread_state[thread_idx] = TS_WAIT_DCACHE;
                else if (!can_issue_thread[thread_idx])
                    thread_state[thread_idx] = TS_WAIT_RAW;
                else if (writeback_conflict)
                    thread_state[thread_idx] = TS_WAIT_WRITEBACK_CONFLICT;
                else
                    thread_state[thread_idx] = TS_READY;
            end

Because writeback_conflict will cause can_issue_thread to be false, that clause can never be hit;

            assign can_issue_thread[thread_idx] = instruction_latched
                && !scoreboard_conflict
                && thread_en[thread_idx]
                && !rollback_this_thread
                && !writeback_conflict
                && !thread_blocked[thread_idx];

Should explicitly check for scoreboard_conflict in the thread_state logging code.

jbush001 commented 6 years ago

Fixed in 21b92456dae6cae861893269e11800033a5ae79c