Skip to content

Commit

Permalink
feat: update project tt_um_jleightcap from jleightcap/tt07
Browse files Browse the repository at this point in the history
Commit: 8ed48304f74f94360a5ea46cd2ba23a3c9e08ae6
Workflow: https://github.com/jleightcap/tt07/actions/runs/9332763685
  • Loading branch information
TinyTapeoutBot authored and urish committed Jun 1, 2024
1 parent c8d17fc commit c29f1d0
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 20 deletions.
1 change: 1 addition & 0 deletions projects/tt_um_jleightcap/LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Expand Down
4 changes: 2 additions & 2 deletions projects/tt_um_jleightcap/commit_id.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"app": "Tiny Tapeout tt07 11b2d371",
"repo": "https://github.com/jleightcap/tt07",
"commit": "4ca64608e28143b638283243d8fd8d42203dda68",
"workflow_url": "https://github.com/jleightcap/tt07/actions/runs/9332458377",
"commit": "8ed48304f74f94360a5ea46cd2ba23a3c9e08ae6",
"workflow_url": "https://github.com/jleightcap/tt07/actions/runs/9332763685",
"sort_id": 1717268031187,
"openlane_version": "OpenLane 337ffbf4749b8bc6e8d8742ed9a595934142198b",
"pdk_version": "open_pdks cd1748bb197f9b7af62a54507de6624e30363943"
Expand Down
74 changes: 60 additions & 14 deletions projects/tt_um_jleightcap/docs/info.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,73 @@
<!---
## How it works

This file is used to generate your project datasheet. Please fill in the information below and delete any unused
sections.
_Fractran_ is an esoteric programming language built around prime factorization.

You can also include images in this folder and reference them in the markdown. Each image must be less than
512 kb in size, and the combined size of all images must be less than 1 MB.
-->
Fractran programs are lists of positive fractions: e.g.,

## How it works
$$
\frac{17}{91},
\frac{78}{85},
\frac{19}{51},
\frac{23}{38},
\frac{29}{33},
\frac{77}{29},
\cdots
$$

Execution follows 3 rules:

1. The program is given an initial input integer $n \in \mathbb{N}$. This is the "accumulator" value.
2. To compute the next state, $n \leftarrow qn$ where $q \in \mathbb{Q}$ is the first fraction in the program where $qn \in \mathbb{N}$.
3. Repeat (2) until no such $q$ exists, then halt with output $n$.

Depending on how terms are represented, (2) is a very simple operating to implement in hardware.
The "cheat" is to operate on pre-factored values: for example, the first few fractions of the above example:

$$
2^0 3^0 5^0 7^{-1} 11^0 13^{-1} 17^1,
2^1 3^1 5^{-1} 7^0 11^0 13^1 17^{-1},
2^0 3^{-1} 5^0 7^0 11^0 13^0 17^{-1} 19^1,
2^{-1} 3^0 5^0 7^0 11^0 13^0 17^0 19^{-1} 23^1,
2^0 3^{-1} 5^0 7^0 11^{-1} 13^0 17^0 19^0 23^0 29^1,
\cdots
$$

An ASIC Fractran interpreter.
For $n = 825 = 3^1 5^2 11^1$, $nq \in \mathbb{N}$ if all pairwise added prime factor degrees are positive: testing $825 \times \frac{17}{91}$:

TODO: explain prime stream representation, factorization as stream addition, etc.
$$
3^1 5^2 11^1 \times 7^{-1} 13^{-1} = 3^1 5^2 7^{-1} 11^1 13^{-1}
$$

The negative degrees are not cancelled by the terms of $n$: testing $825 \times \frac{29}{33}$,

$$
3^1 5^2 11^1 \times 3^{-1} 11^{-1} 29^1 = 5^2 29^1
$$

All negative degrees cancel, and the result is written as the new accumulator.

## How to test

Automated test suite is ran via GitHub actions per the tinytapeout HDL template.
See port mapping in [info.yaml](../info.yaml).

Encodings:
- accumulator: 8-bit unsigned integer degrees. Value `0b11111111` reserved as sentinel "STOP" value.
- fraction: 8-bit signed (one's complement) degrees. Value `0b11111111` (the "second zero") reserved as sentinel "STOP" value.

Apply to these two inputs pair of streams of prime factor degrees.
When the each stream is exhausted, apply the "STOP" value.

TODO: explain test architecture
For each input, there is output:
- resultant degree, or "STOP" when both input streams exhausted, indicating a positive result and accumulator writeback.
- HALT, when a negative degree is calculuated, indicating the start of the next fraction.

## External hardware

TODO:
The logic implemented internally is quite small, requiring support circuitry.
This might include:

- 32KiB RAM
- 32KiB ROM
1. fraction counter: program counter
2. degree pointer: counter for current prime term
3. fraction ROM: storing prime degrees, punctuaed by "STOP"s
4. banked accumulator RAM: two banks of memory to store current accumulator, and calculated value.
on an integral result, the 'scratch' bank is switched to accumulator, old accumulator becomes 'scratch'.
3 changes: 1 addition & 2 deletions projects/tt_um_jleightcap/info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project:
author: "Jack Leightcap"
description: "Hardware implementation of John Conway's estoeric turing-complete lanugage Fractran"
language: "Clash"
clock_hz: 1 # TODO: how to determine max clock rate? or just leave as reasonable minimum?
clock_hz: 1

# How many tiles your design occupies? A single tile is about 167x108 uM.
tiles: "1x1" # Valid values: 1x1, 1x2, 2x2, 3x2, 4x2, 6x2 or 8x2
Expand Down Expand Up @@ -36,7 +36,6 @@ pinout:
uo[6]: "factorized stream [6]"
uo[7]: "factorized stream [7]"

# Bidirectional pins, all configured as inputs
uio[0]: "fraction stream [0]"
uio[1]: "fraction stream [1]"
uio[2]: "fraction stream [2]"
Expand Down
2 changes: 1 addition & 1 deletion projects/tt_um_jleightcap/stats/metrics.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
design,design_name,config,flow_status,total_runtime,routed_runtime,(Cell/mm^2)/Core_Util,DIEAREA_mm^2,CellPer_mm^2,OpenDP_Util,Final_Util,Peak_Memory_Usage_MB,synth_cell_count,tritonRoute_violations,Short_violations,MetSpc_violations,OffGrid_violations,MinHole_violations,Other_violations,Magic_violations,pin_antenna_violations,net_antenna_violations,lvs_total_errors,cvc_total_errors,klayout_violations,wire_length,vias,wns,pl_wns,optimized_wns,fastroute_wns,spef_wns,tns,pl_tns,optimized_tns,fastroute_tns,spef_tns,HPWL,routing_layer1_pct,routing_layer2_pct,routing_layer3_pct,routing_layer4_pct,routing_layer5_pct,routing_layer6_pct,wires_count,wire_bits,public_wires_count,public_wire_bits,memories_count,memory_bits,processes_count,cells_pre_abc,AND,DFF,NAND,NOR,OR,XOR,XNOR,MUX,inputs,outputs,level,DecapCells,WelltapCells,DiodeCells,FillCells,NonPhysCells,TotalCells,CoreArea_um^2,power_slowest_internal_uW,power_slowest_switching_uW,power_slowest_leakage_uW,power_typical_internal_uW,power_typical_switching_uW,power_typical_leakage_uW,power_fastest_internal_uW,power_fastest_switching_uW,power_fastest_leakage_uW,critical_path_ns,suggested_clock_period,suggested_clock_frequency,CLOCK_PERIOD,FP_ASPECT_RATIO,FP_CORE_UTIL,FP_PDN_HPITCH,FP_PDN_VPITCH,GRT_ADJUSTMENT,GRT_REPAIR_ANTENNAS,MAX_FANOUT_CONSTRAINT,PL_TARGET_DENSITY,RUN_HEURISTIC_DIODE_INSERTION,STD_CELL_LIBRARY,SYNTH_STRATEGY
/work/src,tt_um_jleightcap,wokwi,flow completed,0h1m14s0ms,0h0m55s0ms,35533.8317723696,0.01795472,17766.9158861848,16.62,17.227999999999998,517.82,281,0,0,0,0,0,0,0,0,0,0,-1,-1,6427,2171,0.0,-1,-1,-1,-1,0.0,-1,-1,-1,-1,5157828.0,0.0,15.06,8.41,1.76,1.82,-1,331,503,31,193,0,0,0,341,13,0,9,16,33,54,7,37,35,43,15,1097,225,0,298,319,1939,16493.3184,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,21.0,47.61904761904762,20,1,50,26.520,38.870,0.3,1,10,0.6,0,sky130_fd_sc_hd,AREA 0
/work/src,tt_um_jleightcap,wokwi,flow completed,0h1m12s0ms,0h0m53s0ms,35533.8317723696,0.01795472,17766.9158861848,16.62,17.227999999999998,511.09,281,0,0,0,0,0,0,0,0,0,0,-1,-1,6427,2171,0.0,-1,-1,-1,-1,0.0,-1,-1,-1,-1,5157828.0,0.0,15.06,8.41,1.76,1.82,-1,331,503,31,193,0,0,0,341,13,0,9,16,33,54,7,37,35,43,15,1097,225,0,298,319,1939,16493.3184,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,21.0,47.61904761904762,20,1,50,26.520,38.870,0.3,1,10,0.6,0,sky130_fd_sc_hd,AREA 0
Binary file modified projects/tt_um_jleightcap/tt_um_jleightcap.gds
Binary file not shown.
2 changes: 1 addition & 1 deletion projects/tt_um_jleightcap/tt_um_jleightcap.spef
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*SPEF "ieee 1481-1999"
*DESIGN "tt_um_jleightcap"
*DATE "18:51:02 Saturday June 01, 2024"
*DATE "19:51:54 Saturday June 01, 2024"
*VENDOR "The OpenROAD Project"
*PROGRAM "OpenROAD"
*VERSION "da0053d7b0014ab9c87ea148875ff6c2a0f9b658"
Expand Down

0 comments on commit c29f1d0

Please sign in to comment.