OpenCores
URL https://opencores.org/ocsvn/zipcpu/zipcpu/trunk

Subversion Repositories zipcpu

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /zipcpu/trunk/sw
    from Rev 104 to Rev 105
    Reverse comparison

Rev 104 → Rev 105

/zasm/test.S
77,6 → 77,7
sys.bus.ustl equ 0x00f
#define DO_TEST_ASSEMBLER
#define LJMP_TEST
#define EARLY_BRANCH_TEST
#define BREAK_TEST
#define OVERFLOW_TEST
#define CARRY_TEST
241,6 → 242,18
#endif /* and after endif */
 
#ifdef LJMP_TEST
// A long jump is a 32-bit instruction followed by a 32-bit address.
// The CPU is supposed to jump to this address. At issue in this test,
// which can only really be verified by watching it in person currently,
// is how fast this branch can take place. Currently, it takes four
// clocks--not that bad.
//
// Although really long jumps, we also test some of our early branching
// forms here as well:
// 1. Add to PC
// 2. LOD (PC),PC (the long jump itself)
// 3. LDI x,PC // An early branch target not tested elsewhere
//
CLR R0
CLR R1
LJMP
270,6 → 283,77
CMP 4,R0
BNZ test_failure
#endif
#ifdef EARLY_BRANCH_TEST
// Unlike the previous test, this test is going to see whether or not
// early branching messes with the pipeline.
BRA eb_a
BUSY
eb_a:
BRA eb_b
NOP
BUSY
eb_b:
BRA eb_c
NOP
NOP
BUSY
eb_c:
BRA eb_d
NOP
NOP
NOP
BUSY
eb_d:
BRA eb_e
NOP
NOP
NOP
NOP
BUSY
eb_e:
NOOP
// Only problem is, I don't expect it to mess with the pipeline unless
// the pipeline is full. Therefore we are interested in something which
// is not an early branch, conflicting with early branches. So let's
// try loading our pipeline in all kinds of different configurations,
// just to see which if the conditional branch always annihilates the
// early branch as desired.
//
CLR R0
BZ ebz_a
BUSY
ebz_a:
BZ ebz_b
NOP
BUSY
ebz_b:
BZ ebz_c
NOP
NOP
BUSY
// Let's repeat that last test, just in case the cache reloaded itself
// in the middle and we didn't get our proper test.
ebz_c:
BZ ebz_d
NOP
NOP
BUSY
ebz_d:
BZ ebz_e
NOP
NOP
NOP
BUSY
ebz_e:
BZ ebz_f
NOP
NOP
NOP
NOP
BUSY
ebz_f:
NOOP
#endif
 
#ifdef BREAK_TEST
breaktest:

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.