Soft-core processors on resource-constrained FPGAs often suffer from low code density and reliance on proprietary toolchains. This paper details the design, implementation, and evaluation of a 32-bit dual-stack microprocessor architecture optimized for low-cost, resource-constrained Field-Programmable Gate Arrays (FPGAs). Implemented on the Gowin GW1NR-9 (Tang Nano 9K), the processor utilizes an instruction set architecture (ISA) inspired from a subset of the WebAssembly (WASM) specification to achieve high code density. Unlike traditional soft-cores that often rely on proprietary vendor toolchains and opaque IP blocks, this design is synthesized and routed utilizing an open-source flow, providing transparency and portability. The architecture features a dual-stack model (Data and Return), executing directly from SPI Flash via an Execute-in-Place (XIP) mechanism to conserve scarce Block RAM on the intended target device. An analysis of the trade-offs involved in stack depth parametrization is presented, demonstrating that an 8-entry distributed RAM implementation provides a balance between logic resource utilization ($\sim 80\%$) and routing congestion. Furthermore, timing hazards in single-cycle stack operations are identified and resolved through a refined Finite State Machine (FSM) design. The system achieves a stable operating frequency of 27 MHz, limited by Flash latency, and successfully executes simple applications including a single and multi-digit infix calculator.
翻译:在资源受限的现场可编程门阵列(FPGA)上,软核处理器常面临代码密度低及依赖专有工具链的问题。本文详细阐述了一种针对低成本、资源受限FPGA优化的32位双栈微处理器架构的设计、实现与评估。该处理器在Gowin GW1NR-9(Tang Nano 9K)平台上实现,其指令集架构(ISA)借鉴了WebAssembly(WASM)规范的一个子集,以实现高代码密度。与通常依赖专有供应商工具链和不透明IP模块的传统软核不同,本设计采用开源流程进行综合与布线,提供了透明性和可移植性。该架构采用双栈模型(数据栈与返回栈),并通过就地执行(XIP)机制直接从SPI闪存运行程序,以节省目标设备上稀缺的块RAM资源。文中分析了栈深度参数化涉及的权衡,表明采用8项分布式RAM实现能在逻辑资源利用率(约80%)与布线拥塞之间取得平衡。此外,通过改进的有限状态机(FSM)设计,识别并解决了单周期栈操作中的时序冒险问题。该系统在受闪存延迟限制下实现了27 MHz的稳定工作频率,并成功运行了包括单数字与多数字中缀计算器在内的简单应用。