From 2e5a9e67643527dbab7f182fc991f0990a39114b Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 27 Apr 2018 10:06:29 +0100 Subject: [PATCH] add microtest, minitest still too big --- src/spec/__init__.py | 4 ++- src/spec/microtest.py | 74 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 src/spec/microtest.py diff --git a/src/spec/__init__.py b/src/spec/__init__.py index 383cab3..e03c0e3 100644 --- a/src/spec/__init__.py +++ b/src/spec/__init__.py @@ -1,9 +1,11 @@ from spec import m_class from spec import c_class from spec import minitest +from spec import microtest from spec.gen import specgen modules = {'m_class': m_class, 'c_class': c_class, - 'minitest': minitest + 'minitest': minitest, + 'microtest': microtest } diff --git a/src/spec/microtest.py b/src/spec/microtest.py new file mode 100644 index 0000000..fd96669 --- /dev/null +++ b/src/spec/microtest.py @@ -0,0 +1,74 @@ +#!/usr/bin/env python + +from spec.base import PinSpec + +from spec.ifaceprint import display, display_fns, check_functions +from spec.ifaceprint import display_fixed + + +def pinspec(of): + pinbanks = { + 'A': 4, + } + fixedpins = { + 'CTRL_SYS': [ + 'NMI#', + 'RESET#', + ], + 'POWER_GPIO': [ + 'VDD_GPIOA', + 'GND_GPIOA', + ]} + function_names = {'EINT': 'External Interrupt', + 'FB': 'MC68k FlexBus', + 'IIS': 'I2S Audio', + 'JTAG0': 'JTAG (same as JTAG1, JTAG_SEL=LOW)', + 'JTAG1': 'JTAG (same as JTAG0, JTAG_SEL=HIGH)', + 'LCD': '24-pin RGB/TTL LCD', + 'RG': 'RGMII Ethernet', + 'MMC': 'eMMC 1/2/4/8 pin', + 'PWM': 'PWM (pulse-width modulation)', + 'SD0': 'SD/MMC 0', + 'SD1': 'SD/MMC 1', + 'SD2': 'SD/MMC 2', + 'SPI0': 'SPI (Serial Peripheral Interface) 0', + 'SPI1': 'SPI (Serial Peripheral Interface) 1', + 'QSPI': 'Quad SPI (Serial Peripheral Interface) 1', + 'TWI0': 'I2C 0', + 'TWI1': 'I2C 1', + 'TWI2': 'I2C 2', + 'UARTQ0': 'UART (TX/RX/CTS/RTS) 0', + 'UARTQ1': 'UART (TX/RX/CTS/RTS) 1', + 'UART0': 'UART (TX/RX) 0', + 'UART1': 'UART (TX/RX) 1', + 'UART2': 'UART (TX/RX) 2', + 'ULPI0': 'ULPI (USB Low Pin-count) 0', + 'ULPI1': 'ULPI (USB Low Pin-count) 1', + 'ULPI2': 'ULPI (USB Low Pin-count) 2', + } + + ps = PinSpec(pinbanks, fixedpins, function_names) + + # Bank A, 0-3 + ps.gpio("", ('A', 0), 0, 0, 4) + ps.uart("0", ('A', 0), 1) + #ps.uart("1", ('A', 2), 1) + ps.i2c("0", ('A', 1), 2) + + minitest = ['UART0', 'TWI0', ] + minitest_eint = [] + minitest_pwm = [] + descriptions = { + 'TWI0': 'I2C', + 'E2:SD1': '', + 'SPI1': '', + 'UART0': '', + 'B1:LCD/22': '18-bit RGB/TTL LCD', + 'ULPI0/8': 'user-facing: internal (on Card), USB-OTG ULPI PHY', + 'ULPI1': 'dual USB2 Host ULPI PHY' + } + + ps.add_scenario("MiniTest", minitest, minitest_eint, minitest_pwm, + descriptions) + + return ps.write(of) -- 2.30.2