-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #180 from antmicro/rrozak/60210-add-zbb-tests
Add tests of zbs and zbb instructions
- Loading branch information
Showing
4 changed files
with
230 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# Copyright (c) 2023 Antmicro <www.antmicro.com> | ||
# SPDX-License-Identifier: Apache-2.0 | ||
import random | ||
|
||
import pyuvm | ||
from cocotb.triggers import ClockCycles | ||
from pyuvm import * | ||
from testbench import BaseSequence, BaseTest | ||
|
||
# ============================================================================= | ||
|
||
|
||
@pyuvm.test() | ||
class TestClz(BaseTest): | ||
def end_of_elaboration_phase(self): | ||
super().end_of_elaboration_phase() | ||
self.seq = BaseSequence("stimulus", ["clz"]) | ||
|
||
async def run(self): | ||
await self.seq.start(self.env.alu_seqr) | ||
|
||
|
||
@pyuvm.test() | ||
class TestCtz(BaseTest): | ||
def end_of_elaboration_phase(self): | ||
super().end_of_elaboration_phase() | ||
self.seq = BaseSequence("stimulus", ["ctz"]) | ||
|
||
async def run(self): | ||
await self.seq.start(self.env.alu_seqr) | ||
|
||
|
||
@pyuvm.test() | ||
class TestCpop(BaseTest): | ||
def end_of_elaboration_phase(self): | ||
super().end_of_elaboration_phase() | ||
self.seq = BaseSequence("stimulus", ["cpop"]) | ||
|
||
async def run(self): | ||
await self.seq.start(self.env.alu_seqr) | ||
|
||
|
||
@pyuvm.test() | ||
class TestSextb(BaseTest): | ||
def end_of_elaboration_phase(self): | ||
super().end_of_elaboration_phase() | ||
self.seq = BaseSequence("stimulus", ["sext_b"]) | ||
|
||
async def run(self): | ||
await self.seq.start(self.env.alu_seqr) | ||
|
||
|
||
@pyuvm.test() | ||
class TestSexth(BaseTest): | ||
def end_of_elaboration_phase(self): | ||
super().end_of_elaboration_phase() | ||
self.seq = BaseSequence("stimulus", ["sext_h"]) | ||
|
||
async def run(self): | ||
await self.seq.start(self.env.alu_seqr) | ||
|
||
|
||
@pyuvm.test() | ||
class TestRol(BaseTest): | ||
def end_of_elaboration_phase(self): | ||
super().end_of_elaboration_phase() | ||
self.seq = BaseSequence("stimulus", ["rol"]) | ||
|
||
async def run(self): | ||
await self.seq.start(self.env.alu_seqr) | ||
|
||
|
||
@pyuvm.test() | ||
class TestRor(BaseTest): | ||
def end_of_elaboration_phase(self): | ||
super().end_of_elaboration_phase() | ||
self.seq = BaseSequence("stimulus", ["ror"]) | ||
|
||
async def run(self): | ||
await self.seq.start(self.env.alu_seqr) | ||
|
||
|
||
@pyuvm.test() | ||
class TestAll(BaseTest): | ||
def end_of_elaboration_phase(self): | ||
super().end_of_elaboration_phase() | ||
self.seq = BaseSequence( | ||
"stimulus", ["clz", "ctz", "cpop", "sext_b", "sext_h", "rol", "ror"] | ||
) | ||
|
||
async def run(self): | ||
await self.seq.start(self.env.alu_seqr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Copyright (c) 2023 Antmicro <www.antmicro.com> | ||
# SPDX-License-Identifier: Apache-2.0 | ||
import random | ||
|
||
import pyuvm | ||
from cocotb.triggers import ClockCycles | ||
from pyuvm import * | ||
from testbench import BaseSequence, BaseTest | ||
|
||
# ============================================================================= | ||
|
||
|
||
@pyuvm.test() | ||
class TestBset(BaseTest): | ||
def end_of_elaboration_phase(self): | ||
super().end_of_elaboration_phase() | ||
self.seq = BaseSequence("stimulus", ["bset"]) | ||
|
||
async def run(self): | ||
await self.seq.start(self.env.alu_seqr) | ||
|
||
|
||
@pyuvm.test() | ||
class TestBclr(BaseTest): | ||
def end_of_elaboration_phase(self): | ||
super().end_of_elaboration_phase() | ||
self.seq = BaseSequence("stimulus", ["bclr"]) | ||
|
||
async def run(self): | ||
await self.seq.start(self.env.alu_seqr) | ||
|
||
|
||
@pyuvm.test() | ||
class TestBinv(BaseTest): | ||
def end_of_elaboration_phase(self): | ||
super().end_of_elaboration_phase() | ||
self.seq = BaseSequence("stimulus", ["binv"]) | ||
|
||
async def run(self): | ||
await self.seq.start(self.env.alu_seqr) | ||
|
||
|
||
@pyuvm.test() | ||
class TestBext(BaseTest): | ||
def end_of_elaboration_phase(self): | ||
super().end_of_elaboration_phase() | ||
self.seq = BaseSequence("stimulus", ["bext"]) | ||
|
||
async def run(self): | ||
await self.seq.start(self.env.alu_seqr) | ||
|
||
|
||
@pyuvm.test() | ||
class TestAll(BaseTest): | ||
def end_of_elaboration_phase(self): | ||
super().end_of_elaboration_phase() | ||
self.seq = BaseSequence("stimulus", ["bset", "bclr", "binv", "bext"]) | ||
|
||
async def run(self): | ||
await self.seq.start(self.env.alu_seqr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters