litex/test/test_icap.py

34 lines
908 B
Python
Raw Normal View History

#
# This file is part of LiteX.
#
# Copyright (c) 2019 Florent Kermarrec <florent@enjoy-digital.fr>
# SPDX-License-Identifier: BSD-2-Clause
import unittest
from migen import *
from litex.soc.cores.icap import *
class TestICAP(unittest.TestCase):
def test_icap_command_reload(self):
def generator(dut):
yield dut.addr.eq(ICAPRegisters.CMD)
yield dut.data.eq(ICAPCMDs.IPROG)
for i in range(16):
yield
2020-10-07 06:36:08 -04:00
yield dut.send.eq(1)
yield
2020-10-07 06:36:08 -04:00
yield dut.send.eq(0)
for i in range(32):
print(f"{(yield dut._i):08x}")
yield
2020-10-07 06:36:08 -04:00
dut = ICAP(with_csr=False, simulation=True)
clocks = {"sys": 10, "icap": 10}
run_simulation(dut, generator(dut), clocks, vcd_name="icap.vcd")
def test_icap_bitstream_syntax(self):
dut = ICAPBitstream(simulation=True)