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/m.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燈, 水草

請輸入看板名稱,例如:e-shopping站內搜尋

TOP