This document describes the purpose and design methodology of the Small Stack-Based Computer Compiler (SSBCC).

The system is designed to run a Forth-like assembly.

Introduction

The purpose of the SSBCC is to generate small microcontrollers for use in FPGAs. This computer compiler is designed to generate FPGA-vendor independent systems in either Verilog or VHDL. The resulting micro controller is described by a single HDL file containing the processor core, the program, data stack, return stack, and variable memory.

The archive consists of the computer compiler, micro computer cores and assemblers, and libraries.

Processor Architecture

TODO -- RFS: describe the general architecture

8-bit Processor Example

This section demonstrates how to generate a 8-bit processor with 9-bit wide instructions. The 8-bit data width was chosen because it is characteristic of embedded systems controlling other processes and generating ascii output. The 9-bit data width was chosen because the FPGAs produced by the three major FPGA vendors produce memories with 8-bit data widths.

The processor is described by a regular text file with the following contents:

Processor Description Syntax

Memory Description

Core Description Syntax

Opcode List

This section lists the opcodes and describes how the compiler is to implement them.

TODO -- RFS: Determine this syntax

HDL Section(s)

Each of these sections lists the processor core implementation in the specified language.

The languages currently supported by the compiler are Verilog and VHDL.

Syntax: HDL {Verilog|VHDL} ... ENDHDL

Example:
HDL Verilog
  always @ (posedge i_clk) begin
    s_stack_addr <= s_stack_addr;
    if (s_opcode[C_NBITS_OPCODE-1] = 1'b0) begin
      s_stack[s_stack_addr] <= s_opcode[C_NBITS_OPCODE-2:0];
      s_stack_addr <= s_stack_addr + 1;
    else
    end
  end
ENDHDL