CompilerDev 板


LINE

J1 Forth CPU 是完整的 FORTH 系统。 相对简单易学。 J1 is a small (200 lines of Verilog) stack-based CPU, intended for FPGAs. A complete J1 with 16Kbytes of RAM fits easily on a small Xilinx FPGA. Some highlights: Extremely high code density. A complete system including the TCP/IP stack fits in under 8K bytes. Single cycle call, zero cycle return Instruction set maps trivially to Forth Cross compiler runs on Windows, Mac and Unix Basic software includes a sizeable subset of ANS Forth and a portable TCP/IP networking stack. J1 was originally designed to run the six WGE100 Ethernet cameras in the Willow Garage PR2 robot. More recently it was shown at SVFIG Forth Day 2010 on an XESS FPGA board (see Loading the XESS XSA-3S1000 from Python) running a few demonstration programs, including space invaders, Forth source invaders.fs. https://www.excamera.com/files/j1.pdf https://www.excamera.com/sphinx/fpga-j1.html https://www.excamera.com/files/j1demo.tar.gz Assembler 核心是下列几行程式码 crossj1.fs : j1asm only metacompiler also j1assembler definitions also forth ; j1asm : hex-literal ( u -- c-addr u ) s>d <# bl hold #s [char] $ hold #> ; : imm h# 8000 or t, ; : T h# 0000 ; : N h# 0100 ; : T+N h# 0200 ; : T&N h# 0300 ; : T|N h# 0400 ; : T^N h# 0500 ; : ~T h# 0600 ; : N==T h# 0700 ; : N<T h# 0800 ; : N>>T h# 0900 ; : T-1 h# 0a00 ; : rT h# 0b00 ; : [T] h# 0c00 ; : N<<T h# 0d00 ; : dsp h# 0e00 ; : Nu<T h# 0f00 ; : T->N h# 0080 or ; : T->R h# 0040 or ; : N->[T] h# 0020 or ; : d-1 h# 0003 or ; : d+1 h# 0001 or ; : r-1 h# 000c or ; : r-2 h# 0008 or ; : r+1 h# 0004 or ; : alu h# 6000 or t, ; : return T h# 1000 or r-1 alu ; : ubranch 2/ h# 0000 or t, ; : 0branch 2/ h# 2000 or t, ; : scall 2/ h# 4000 or t, ; FORTH 前辈有仔细研究过: http://sparkforth.blogspot.com/search/label/forth J1 Forth CPU 研究之一:Camera Firmware 的程式结构 J1 Forth CPU 研究之二:如何以 Xilinx ISE 来 Synthesize J1 CPU J1 Forth CPU 研究之三:系统重设和 program counter J1 Forth CPU 研究之四:资料堆叠和返回堆叠 J1 Forth CPU 研究之五:算术逻辑单元(ALU) J1 Forth CPU 研究之一:Camera Firmware 的程式结构 首先,看看这个目录里最重要的几个档案: main.fs:这是主程式 crossj1.fs:这是 J1 的 Cross compiler basewords.fs:在这儿,以 j1 的 assembler 来定义了基本的 Forth 指令。 对许多初学 Forth 的人来说,Cross compiler 无疑是最神秘玄奇之物了。 因此让我们先看看它。只有 512 行,真的很短,在里面最重要的三个命令是: meta:执行 meta 後就可以开始定义 J1 的 Cross compiler (或称为 metacompiler) 了。 target:执行 target 後,之後定义的指令或是资料结构最後都会被放到 target 里,也就是 j1 16k 的 RAM 里。 j1asm:执行 j1asm 後可以开始定义 j1 的 assembler。 --



※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 114.43.77.156 (台湾)
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/CompilerDev/M.1591584854.A.D6E.html
1F:推 snaketsai: 推,J1满好玩的。他们之前有做一个简化版的j1a,可以放 06/08 16:01
2F:→ snaketsai: 到便宜的Lattice iCEStick上面 06/08 16:01
3F:→ snaketsai: 而且有E2E开源的Syn-APR-Bitgen flow可以玩 06/08 16:02
4F:→ snaketsai: https://youtu.be/rdLgLCIDSk0 06/08 16:03
5F:推 mshockwave: 有趣 我昨天才在看用Forth做的OS 这语言真的神奇 06/09 02:09







like.gif 您可能会有兴趣的文章
icon.png[问题/行为] 猫晚上进房间会不会有憋尿问题
icon.pngRe: [闲聊] 选了错误的女孩成为魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一张
icon.png[心得] EMS高领长版毛衣.墨小楼MC1002
icon.png[分享] 丹龙隔热纸GE55+33+22
icon.png[问题] 清洗洗衣机
icon.png[寻物] 窗台下的空间
icon.png[闲聊] 双极の女神1 木魔爵
icon.png[售车] 新竹 1997 march 1297cc 白色 四门
icon.png[讨论] 能从照片感受到摄影者心情吗
icon.png[狂贺] 贺贺贺贺 贺!岛村卯月!总选举NO.1
icon.png[难过] 羡慕白皮肤的女生
icon.png阅读文章
icon.png[黑特]
icon.png[问题] SBK S1安装於安全帽位置
icon.png[分享] 旧woo100绝版开箱!!
icon.pngRe: [无言] 关於小包卫生纸
icon.png[开箱] E5-2683V3 RX480Strix 快睿C1 简单测试
icon.png[心得] 苍の海贼龙 地狱 执行者16PT
icon.png[售车] 1999年Virage iO 1.8EXi
icon.png[心得] 挑战33 LV10 狮子座pt solo
icon.png[闲聊] 手把手教你不被桶之新手主购教学
icon.png[分享] Civic Type R 量产版官方照无预警流出
icon.png[售车] Golf 4 2.0 银色 自排
icon.png[出售] Graco提篮汽座(有底座)2000元诚可议
icon.png[问题] 请问补牙材质掉了还能再补吗?(台中半年内
icon.png[问题] 44th 单曲 生写竟然都给重复的啊啊!
icon.png[心得] 华南红卡/icash 核卡
icon.png[问题] 拔牙矫正这样正常吗
icon.png[赠送] 老莫高业 初业 102年版
icon.png[情报] 三大行动支付 本季掀战火
icon.png[宝宝] 博客来Amos水蜡笔5/1特价五折
icon.pngRe: [心得] 新鲜人一些面试分享
icon.png[心得] 苍の海贼龙 地狱 麒麟25PT
icon.pngRe: [闲聊] (君の名は。雷慎入) 君名二创漫画翻译
icon.pngRe: [闲聊] OGN中场影片:失踪人口局 (英文字幕)
icon.png[问题] 台湾大哥大4G讯号差
icon.png[出售] [全国]全新千寻侘草LED灯, 水草

请输入看板名称,例如:iOS站内搜寻

TOP