X-Received: by 2002:ac8:7c2:0:b0:3a5:4c54:c0a6 with SMTP id m2-20020ac807c2000000b003a54c54c0a6mr36158937qth.651.1669812948619; Wed, 30 Nov 2022 04:55:48 -0800 (PST) X-Received: by 2002:ac8:564e:0:b0:3a6:6bed:e771 with SMTP id 14-20020ac8564e000000b003a66bede771mr23056803qtt.686.1669812948413; Wed, 30 Nov 2022 04:55:48 -0800 (PST) Path: ...!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.forth Date: Wed, 30 Nov 2022 04:55:48 -0800 (PST) Injection-Info: google-groups.googlegroups.com; posting-host=199.48.66.218; posting-account=zkoivgoAAABqROvHfKJPu3S9NWXITnSr NNTP-Posting-Host: 199.48.66.218 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <97d644a8-d38f-49b0-b73e-45ae276d327fn@googlegroups.com> Subject: BugsBoard: an FPGA design for the Digilent Cmod S7 From: Myron Plichota Injection-Date: Wed, 30 Nov 2022 12:55:48 +0000 Content-Type: text/plain; charset="UTF-8" Bytes: 2801 Lines: 65 The hardware is defined in Verilog. The *structured* assembler is written in Python3. Apps source code plays ball with the Python3 foundation. e.g. apps/color_toy.py: include('FPGAburn/appload.py') # must be on the first line # play with LD0 color ja(fwd('init')) lbl('app_msg'); ascii('\r\npress BTN0 to reset') # color intensities lbl('red'); data([0]) lbl('green'); data([0]) lbl('blue'); data([0]) # commands lbl('ir') # char -> # increment red drop(); lld(red); inc(); lst(red); ret() lbl('dr') # char -> # decrement red drop(); lld(red); dec(); lst(red); ret() lbl('ig') # char -> # increment green drop(); lld(green); inc(); lst(green); ret() lbl('dg') # char -> # decrement green drop(); lld(green); dec(); lst(green); ret() lbl('ib') # char -> # increment blue drop(); lld(blue); inc(); lst(blue); ret() lbl('db') # char -> # decrement blue drop(); lld(blue); dec(); lst(blue); ret() lbl('command') # -> # execute a recognized command lld(arx_rdy) _if() lld(uart); dup(); cp(tx) # -> char # echo dup(); lbxor(ord('R')); jz(ir) dup(); lbxor(ord('r')); jz(dr) dup(); lbxor(ord('G')); jz(ig) dup(); lbxor(ord('g')); jz(dg) dup(); lbxor(ord('B')); jz(ib) dup(); lbxor(ord('b')); jz(db) drop() # none of the above _then() ret() lbl('init') lit(app_msg); cp(tx_ascii) _begin() cp(command) lld(red); lst(pwm1) lld(green); lst(pwm2) lld(blue); lst(pwm3) _again() lbl('app_end') # must be on the last line BugsBoard_Primer.pdf is at https://drive.google.com/file/d/14iPt_j_lmINSs4cte3_MneA6D4UCBjZi/view?usp=sharing A link to Bugs18bis.zip is in the downloads section. Cheers - Myron Plichota