Skip to content

Add unit tests for bypass module #716

Open
pavelkryukov opened this issue Nov 23, 2018 · 9 comments
Open

Add unit tests for bypass module #716

pavelkryukov opened this issue Nov 23, 2018 · 9 comments
Labels
3 Features of medium complexity or infrastructure enhancements good first issue Good task to start with MIPT-MIPS development S1 — Pipeline To solve the issue, you need knowledge about pipeline, data bypass, scoreboarding testing Improves testing coverage

Comments

@pavelkryukov
Copy link
Member

pavelkryukov commented Nov 23, 2018

Please follow:

The idea is to model pipeline in a small scale:

    DataBypass db( 7);
    MIPS32Instr load( "ld");
    load->dst = MIPSRegister::from_cpu_index( 1);
    MIPS32Instr add( "add");
    add->src = MIPSRegister::from_cpu_index( 1);
    db.trace_new_instr( load);
    db.update(); // Go to next cycle
    CHECK( db.is_stall( add) ); // Add should have a data hazard
@pavelkryukov pavelkryukov added testing Improves testing coverage 3 Features of medium complexity or infrastructure enhancements S1 — Pipeline To solve the issue, you need knowledge about pipeline, data bypass, scoreboarding labels Nov 23, 2018
@bova-ev bova-ev self-assigned this Apr 20, 2019
@bova-ev
Copy link
Contributor

bova-ev commented Apr 20, 2019

Do I have to test data_bypass_interface.h as well?

@pavelkryukov
Copy link
Member Author

Disclaimer: you have 10 points already in this term. Any additional work will not affect your final result.

@pavelkryukov
Copy link
Member Author

class RegisterState is trivial, we'll re-write it as a simple data structure later,
class BypassCommand may be tested

@bova-ev
Copy link
Contributor

bova-ev commented Apr 20, 2019

Ok. How do I add new unit_test to the project?

@pavelkryukov
Copy link
Member Author

Add the name of the file to that list:

set(TESTS_CPPS
infra/t/unit_test.cpp
infra/cache/t/unit_test.cpp
infra/config/t/unit_test.cpp
infra/instrcache/t/unit_test.cpp
infra/replacement/t/unit_test.cpp
infra/ports/port_queue/t/unit_test.cpp
infra/ports/t/unit_test.cpp
infra/ports/t/example_test.cpp
kernel/t/unit_test.cpp
kernel/mars/t/unit_test.cpp
memory/cen64/t/unit_test.cpp
memory/t/check_coherency.cpp
memory/t/unit_test.cpp
mips/mips_register/t/unit_test.cpp
mips/t/unit_test.cpp
func_sim/rf/t/unit_test.cpp
risc_v/riscv_register/t/unit_test.cpp
risc_v/t/unit_test.cpp
risc_v/t/riscv64_test.cpp
modules/fetch/bpu/t/unit_test.cpp
func_sim/t/unit_test.cpp
modules/core/t/unit_test.cpp
export/gdb/t/unit_test.cpp

@bova-ev
Copy link
Contributor

bova-ev commented Apr 21, 2019

I’ve spent a lot of time figuring out what FuncInstr in DataBypass template stands for and I still couldn’t find the answer. The question is how to create an object of this class so it’ll have correct FuncInstr? All my attempts of filling this field led me to the conflict with missing methods.

@pavelkryukov
Copy link
Member Author

You may use RISC-V instruction

DataBypass<RISCVInstr<uint64>> bypass;

or create a dummy instruction

struct DummyInstr
{
    // necessary methods and type definitions
};
DataBypass<DummyInstr> bypass;

bova-ev added a commit to bova-ev/mipt-mips that referenced this issue Apr 23, 2019
@bova-ev
Copy link
Contributor

bova-ev commented May 7, 2019

Unfortunately, I'm not able to finish this issue until this night due to studies. My apologies.

@pavelkryukov pavelkryukov added the good first issue Good task to start with MIPT-MIPS development label May 7, 2019
@pavelkryukov
Copy link
Member Author

Thank you for notification.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3 Features of medium complexity or infrastructure enhancements good first issue Good task to start with MIPT-MIPS development S1 — Pipeline To solve the issue, you need knowledge about pipeline, data bypass, scoreboarding testing Improves testing coverage
Projects
None yet
Development

No branches or pull requests

2 participants