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

Subversion Repositories tinycpu

[/] [tinycpu/] [trunk/] [testbench/] [core_tb.vhd] - Diff between revs 26 and 27

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 26 Rev 27
Line 132... Line 132...
    MemIn <= x"1050"; --mov [r0], 0x50 (r0 is 0x20)
    MemIn <= x"1050"; --mov [r0], 0x50 (r0 is 0x20)
    wait for 10 ns;
    wait for 10 ns;
    MemIn <= x"0025"; --mov r0,0x25
    MemIn <= x"0025"; --mov r0,0x25
    assert(DebugR0 = x"20" and DebugTR='0') report "moved to r0 conditional thought TR is 0" severity error;
    assert(DebugR0 = x"20" and DebugTR='0') report "moved to r0 conditional thought TR is 0" severity error;
    assert(MemAddr = x"0020" and MemWE='1' and MemWW='0' and MemOut=x"0050") report "Write to memory doesn't work" severity error;
    assert(MemAddr = x"0020" and MemWE='1' and MemWW='0' and MemOut=x"0050") report "Write to memory doesn't work" severity error;
 
    wait for 20 ns; --wait an extra cycle because of WaitForMemory state
 
    MemIn <= x"0235"; --mov r1,0x35
    wait for 10 ns;
    wait for 10 ns;
 
    MemIn <= "0011000000010000"; --compare greater than r0, r1 : TR=r0 > r1
 
    wait for 10 ns;
 
    assert(DebugTR ='0') report "ALU compare is not correct for greater than" severity error;
 
    MemIn <= "0011000000010010"; --TR=r0 < r1
 
    wait for 20 ns;
 
    assert(DebugTR='1') report "ALU compare is not correct for less than" severity error;
    --wait for 10 ns; --have to wait an extra cycle for memory
    --wait for 10 ns; --have to wait an extra cycle for memory
 
 
    -- summary of testbench
    -- summary of testbench
    assert false
    assert false
    report "Testbench of core completed successfully!"
    report "Testbench of core completed successfully!"

powered by: WebSVN 2.1.0

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