-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update project tt_um_jleightcap from jleightcap/tt07
Commit: 8ed48304f74f94360a5ea46cd2ba23a3c9e08ae6 Workflow: https://github.com/jleightcap/tt07/actions/runs/9332763685
- Loading branch information
1 parent
c8d17fc
commit c29f1d0
Showing
7 changed files
with
66 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters