{"id":19686258,"url":"https://github.com/calint/zen-x","last_synced_at":"2026-03-19T11:04:48.122Z","repository":{"id":163049716,"uuid":"637556284","full_name":"calint/zen-x","owner":"calint","description":"experimental retro 16 bit cpu written in verilog xilinx vivado intended for fpga Cmod S7 from Digilent","archived":false,"fork":false,"pushed_at":"2024-05-29T01:43:31.000Z","size":24908,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-27T08:56:48.926Z","etag":null,"topics":["16-bit","cmod-s7","cpu","fpga","verilog","vintage","vivado","xilinx"],"latest_commit_sha":null,"homepage":"","language":"Verilog","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/calint.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-07T22:52:07.000Z","updated_at":"2024-05-29T01:43:34.000Z","dependencies_parsed_at":"2024-05-29T04:21:01.612Z","dependency_job_id":"4ccd6872-6dcd-432f-80d7-5073233b7638","html_url":"https://github.com/calint/zen-x","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/calint/zen-x","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calint%2Fzen-x","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calint%2Fzen-x/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calint%2Fzen-x/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calint%2Fzen-x/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/calint","download_url":"https://codeload.github.com/calint/zen-x/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calint%2Fzen-x/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30081446,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T13:22:36.021Z","status":"ssl_error","status_checked_at":"2026-03-04T13:20:45.750Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["16-bit","cmod-s7","cpu","fpga","verilog","vintage","vivado","xilinx"],"created_at":"2024-11-11T18:27:01.360Z","updated_at":"2026-03-04T13:32:39.971Z","avatar_url":"https://github.com/calint.png","language":"Verilog","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zen-x\n\n\u003e :bell: development continued in project [zen-one](https://github.com/calint/zen-one)\n\nexperimental retro 16 bit cpu written in verilog xilinx vivado intended for fpga Cmod S7 from Digilent\n\n2 cycles / instruction\n\npre pipeline\n\nsecond try at fpga verilog vivado\n\n```\n                          \n                          \n                       z   n - r   c      vintage 16 bit cpu\n                       e   e   e   a \n                       r   g   t   l      64K 16 bit instructions\n                       o   a   u   l      64K 16 bit data\n                           t   r          16  16 bit registers\n                           i   n          64  calls stack\n                           v              66  MHz\n                           e\n\n                     | 0 | 1 | 2 | 3 |   4 - 7   | 8-11 | 12-15|        \n                     |---|---|---|---|-----------|------|------|        \n                     | z | n | r | c |   op      | rega | regb |        \n                     |---|---|---|---|---|-------|------|------|--------\n                     / . / . / . / 0 / 0 / 0 0 0 / .... / .... /  add  /\n                    / . / . / . / 0 / 0 / 1 0 0 / .... / .... /  sub  / \n                   / . / . / . / 0 / 0 / 0 1 0 / .... / .... /  or   / \n                  / . / . / . / 0 / 0 / 1 1 0 / .... / .... /  xor  / \n                 / . / . / . / 0 / 0 / 0 0 1 / .... / .... /  and  / \n                / . / . / . / 0 / 0 / 1 0 1 / ...  / .... /  not  / \n               / . / . / . / 0 / 0 / 0 1 1 / .... / .... /  cp   / \n              / . / . / . / 0 / 0 / 1 1 1 / imm4 / .... /  shf  / \n             /---/---/---/---/---/-------/------/------/-------/ \n            / . / . / . / 0 / 1 / 0 0 0 / imm4 / .... /  addi / \n           / . / . / . / 0 / 1 / 1 0 0 / 0000 / .... /  ldi  / \n          / . / . / . / 0 / 1 / 0 1 0 / src  / dst  /  ld   / \n         / . / . / . / 0 / 1 / 1 1 0 / dst  / src  /  st   / \n        / . / . / . / 0 / 1 / 0 0 1 / .... / .... /       / \n       / . / . / . / 0 / 1 / 1 0 1 / .... / .... /       / \n      / . / . / . / 0 / 1 / 0 1 1 / .... / .... /       / \n     / . / . / . / 0 / 1 / 1 1 1 / .... / .... /       / \n    /---/---/---/---/---/-------/------/------/-------/ \n   / . / . / 0 / 1 /    immediate 12 \u003c\u003c 4    /  call / \n  / . / . / 1 / 1 /   signed immediate 12   /  jmp  / \n /---/---/---/---/---/-------/------/------/-------/ \n \\ . \\ . \\ . \\ 0 \\ 1 \\ 1 0 0 \\ 0100 \\ .... \\  wl   \\\n  \\ . \\ . \\ . \\ 0 \\ 1 \\ 1 0 0 \\ 0101 \\ .... \\  wh   \\\n   \\ . \\ . \\ . \\ 0 \\ 1 \\ 1 0 0 \\ 0110 \\ .... \\  rl   \\\n    \\ . \\ . \\ . \\ 0 \\ 1 \\ 1 0 0 \\ 0111 \\ .... \\  rh   \\\n     \\ . \\ . \\ . \\ 0 \\ 1 \\ 1 0 0 \\ 1100 \\ .... \\       \\\n      \\ . \\ . \\ . \\ 0 \\ 1 \\ 1 0 0 \\ 1101 \\ .... \\       \\\n       \\ . \\ . \\ . \\ 0 \\ 1 \\ 1 0 0 \\ 1110 \\ .... \\ led   \\\n        \\ . \\ . \\ . \\ 0 \\ 1 \\ 1 0 0 \\ 1111 \\ imm4 \\ ledi  \\\n \n\n  op  :       : cyc |\n -----:-------:-----:--------------------------------------\n 0000 : add   :  2  : reg[b] += reg[a]\n 0010 : sub   :  2  : reg[b] -= reg[a] \n 0100 : or    :  2  : reg[b] |= reg[a] \n 0110 : xor   :  2  : reg[b] ^= reg[a] \n 1000 : and   :  2  : reg[b] \u0026= reg[a] \n 1010 : not   :  2  : reg[b] = ~reg[a] \n 1100 : cp    :  2  : reg[b] = reg[a]\n 1110 : shf   :  2  : reg[b] \u003e\u003e= (imm4\u003e=0?++imm4:-imm4)\n -----:-------:-----:--------------------------------------\n 0001 : addi  :  2  : reg[b] += (imm4\u003e=0?++imm4:-imm4)\n 0011 : ldi   :  4  : reg[b] = { next instruction }\n 0101 : ld    :  2  : reg[b] = ram[a]\n 0111 : st    :  2  : ram[a] = reg[b]\n 1001 :       :     : \n 1011 :       :     :\n 1101 :       :     :\n 1111 :       :     : \n -----:-------:-----:--------------------------------------\n\n  rc  :       : cyc :\n -----+-------+-----+--------------------------------------\n  01  : call  :  2  : pc = imm12 \u003c\u003c 4\n  11  : jmp   :  2  : pc += signed imm12\n -----+-------+-----+--------------------------------------\n\ni/o\n |z|n|r|c| op |rega|regb| mnemo | description\n |-+-+-+-+----+----+----+-------+--------------------------------------\n |.|.|.|0|1100|0100|....|  wl   | uart blocking write lower regs[b]\n |.|.|.|0|1100|0101|....|  wh   | uart blocking write higher regs[b]\n |.|.|.|0|1100|0110|....|  rl   | uart blocking read lower regs[b]\n |.|.|.|0|1100|0111|....|  rh   | uart blocking read higher regs[b]\n |.|.|.|0|1100|1100|....|       | \n |.|.|.|0|1100|1101|....|       | \n |.|.|.|0|1100|1110|....|  led  | sets leds to lower 4 bits of regs[b]\n |.|.|.|0|1100|1111|imm4|  ledi | sets leds to imm4\n\nzn flags in instructions are compared with current flags\ninstruction executes according to:\n * zn=11 : always\n * zn=00 : positive number\n * zn=10 : zero\n * zn=01 : negative number\n\ninstructions with rc=10 return from call\n\nhow-to with Vivado v2023.1:\n * to program device edit path to ROM in \"zen-x.srcs/sources_1/new/Top.v\"\n * connect fpga board Cmod S7 from digilent.com\n * run synthesis, run implementation, program device\n * find out which tty is on the usb connected to the card (i.e. /dev/ttyUSB1)\n * connect with terminal at 9600 baud, 8 bits, 1 stop bit, no parity \n * button 0 is reset, click it to restart and display the prompt\n * \"HELLO\" is the prompt\n * after the tests and prompt the program enters a read / write loop (echo)\n * provided ROM is meant for tests run in the simulator\n\nprogramming zen-x\n * use 'zasm' to compile assembler code\n * see 'notes/zasm-samples/' for examples.\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalint%2Fzen-x","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcalint%2Fzen-x","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalint%2Fzen-x/lists"}