Skip to content

Commit

Permalink
Merge pull request #1 from FlyGoat/update
Browse files Browse the repository at this point in the history
Bump to upstream latest
  • Loading branch information
FlyGoat authored Jan 10, 2025
2 parents a6e8fd1 + 84808b2 commit 3b15922
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 34 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
# Always clone the full depth so git-describe works.
fetch-depth: 0
Expand Down Expand Up @@ -70,14 +70,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
# Always clone the full depth so git-describe works.
fetch-depth: 0
submodules: true

- name: Set up Python 🐍 ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ with open(data_file(my_data_file)) as f:
```


The data files come from https://github.com/cliffordwolf/picorv32
The data files come from https://github.com/YosysHQ/picorv32
and are imported using `git subtrees` to the directory
[pythondata_cpu_picorv32/verilog](pythondata_cpu_picorv32/verilog).

Expand Down Expand Up @@ -104,6 +104,6 @@ pythondata-cpu-picorv32
# Issues and Fixes

This package is autogenerated from the sources in
<https://github.com/cliffordwolf/picorv32>
<https://github.com/YosysHQ/picorv32>
using the [pythondata-auto](https://github.com/litex-hub/pythondata-auto)
toolset. Pull requests and issues on this pythondata repo may not be monitored.
35 changes: 16 additions & 19 deletions pythondata_cpu_picorv32/__init__.py
Original file line number Diff line number Diff line change
@@ -1,45 +1,42 @@
import os.path
__dir__ = os.path.split(os.path.abspath(os.path.realpath(__file__)))[0]
data_location = os.path.join(__dir__, "verilog")
src = "https://github.com/cliffordwolf/picorv32"
src = "https://github.com/YosysHQ/picorv32"

# Module version
version_str = "1.0.post194"
version_tuple = (1, 0, 194)
version_str = "1.0.post218"
version_tuple = (1, 0, 218)
try:
from packaging.version import Version as V
pversion = V("1.0.post194")
pversion = V("1.0.post218")
except ImportError:
pass

# Data version info
data_version_str = "1.0.post52"
data_version_tuple = (1, 0, 52)
data_version_str = "1.0.post70"
data_version_tuple = (1, 0, 70)
try:
from packaging.version import Version as V
pdata_version = V("1.0.post52")
pdata_version = V("1.0.post70")
except ImportError:
pass
data_git_hash = "f00a88c36eaab478b64ee27d8162e421049bcc66"
data_git_describe = "v1.0-52-gf00a88c"
data_git_hash = "87c89acc18994c8cf9a2311e871818e87d304568"
data_git_describe = "v1.0-70-g87c89acc1899"
data_git_msg = """\
commit f00a88c36eaab478b64ee27d8162e421049bcc66
Merge: 1d9f5b7 e8dbd9a
Author: Claire Xen <[email protected]>
Date: Mon Jan 3 16:03:13 2022 +0100
commit 87c89acc18994c8cf9a2311e871818e87d304568
Author: Miodrag Milanovic <[email protected]>
Date: Mon Jun 17 08:20:13 2024 +0200
Merge pull request #209 from YosysHQ/micko/cleanups
Cleanups
clean Makefile
"""

# Tool version info
tool_version_str = "0.0.post142"
tool_version_tuple = (0, 0, 142)
tool_version_str = "0.0.post148"
tool_version_tuple = (0, 0, 148)
try:
from packaging.version import Version as V
ptool_version = V("0.0.post142")
ptool_version = V("0.0.post148")
except ImportError:
pass

Expand Down
37 changes: 37 additions & 0 deletions pythondata_cpu_picorv32/verilog/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
on:
push:
pull_request:
workflow_dispatch:

jobs:
riscv-formal:
runs-on: ubuntu-latest

steps:
- name: Checkout picorv32.v
uses: actions/checkout@v4
with:
sparse-checkout: |
picorv32.v
sparse-checkout-cone-mode: false
- name: Checkout riscv-formal
uses: actions/checkout@v4
with:
repository: YosysHQ/riscv-formal
path: riscv-formal
- name: cp picorv32.v
run: |
cp picorv32.v -t riscv-formal/cores/picorv32
- uses: YosysHQ/setup-oss-cad-suite@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: make checks
run: |
cd riscv-formal/cores/picorv32
make checks -j$(nproc)
- name: make check
run: |
cd riscv-formal/cores/picorv32
make check
8 changes: 5 additions & 3 deletions pythondata_cpu_picorv32/verilog/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[![.github/workflows/ci.yml](https://github.com/YosysHQ/picorv32/actions/workflows/ci.yml/badge.svg)](https://github.com/YosysHQ/picorv32/actions/workflows/ci.yml)

PicoRV32 - A Size-Optimized RISC-V CPU
======================================
Expand Down Expand Up @@ -237,7 +238,9 @@ triggering an interrupt.

#### ENABLE_PCPI (default = 0)

Set this to 1 to enable the Pico Co-Processor Interface (PCPI).
Set this to 1 to enable the _external_ Pico Co-Processor Interface (PCPI).
The external interface is not required for the internal PCPI cores, such as
`picorv32_pcpi_mul`.

#### ENABLE_MUL (default = 0)

Expand Down Expand Up @@ -284,7 +287,7 @@ Support for the timer is always disabled when ENABLE_IRQ is set to 0.
#### ENABLE_TRACE (default = 0)

Produce an execution trace using the `trace_valid` and `trace_data` output ports.
For a demontration of this feature run `make test_vcd` to create a trace file
For a demonstration of this feature run `make test_vcd` to create a trace file
and then run `python3 showtrace.py testbench.trace firmware/firmware.elf` to decode
it.

Expand Down Expand Up @@ -735,4 +738,3 @@ See `make area` in [scripts/vivado/](scripts/vivado/).
| PicoRV32 (small) | 761 | 48 | 442 |
| PicoRV32 (regular) | 917 | 48 | 583 |
| PicoRV32 (large) | 2019 | 88 | 1085 |

2 changes: 0 additions & 2 deletions pythondata_cpu_picorv32/verilog/firmware/start.S
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,7 @@ irq_vec:

picorv32_retirq_insn()

#ifndef ENABLE_QREGS
.balign 0x200
#endif
irq_regs:
// registers are saved to this memory region during interrupt handling
// the program counter is saved as register 0
Expand Down
11 changes: 8 additions & 3 deletions pythondata_cpu_picorv32/verilog/picorv32.v
Original file line number Diff line number Diff line change
Expand Up @@ -648,11 +648,12 @@ module picorv32 #(
reg instr_lb, instr_lh, instr_lw, instr_lbu, instr_lhu, instr_sb, instr_sh, instr_sw;
reg instr_addi, instr_slti, instr_sltiu, instr_xori, instr_ori, instr_andi, instr_slli, instr_srli, instr_srai;
reg instr_add, instr_sub, instr_sll, instr_slt, instr_sltu, instr_xor, instr_srl, instr_sra, instr_or, instr_and;
reg instr_rdcycle, instr_rdcycleh, instr_rdinstr, instr_rdinstrh, instr_ecall_ebreak;
reg instr_rdcycle, instr_rdcycleh, instr_rdinstr, instr_rdinstrh, instr_ecall_ebreak, instr_fence;
reg instr_getq, instr_setq, instr_retirq, instr_maskirq, instr_waitirq, instr_timer;
wire instr_trap;

reg [regindex_bits-1:0] decoded_rd, decoded_rs1, decoded_rs2;
reg [regindex_bits-1:0] decoded_rd, decoded_rs1;
reg [4:0] decoded_rs2;
reg [31:0] decoded_imm, decoded_imm_j;
reg decoder_trigger;
reg decoder_trigger_q;
Expand Down Expand Up @@ -680,7 +681,7 @@ module picorv32 #(
instr_lb, instr_lh, instr_lw, instr_lbu, instr_lhu, instr_sb, instr_sh, instr_sw,
instr_addi, instr_slti, instr_sltiu, instr_xori, instr_ori, instr_andi, instr_slli, instr_srli, instr_srai,
instr_add, instr_sub, instr_sll, instr_slt, instr_sltu, instr_xor, instr_srl, instr_sra, instr_or, instr_and,
instr_rdcycle, instr_rdcycleh, instr_rdinstr, instr_rdinstrh,
instr_rdcycle, instr_rdcycleh, instr_rdinstr, instr_rdinstrh, instr_fence,
instr_getq, instr_setq, instr_retirq, instr_maskirq, instr_waitirq, instr_timer};

wire is_rdcycle_rdcycleh_rdinstr_rdinstrh;
Expand Down Expand Up @@ -746,6 +747,7 @@ module picorv32 #(
if (instr_rdcycleh) new_ascii_instr = "rdcycleh";
if (instr_rdinstr) new_ascii_instr = "rdinstr";
if (instr_rdinstrh) new_ascii_instr = "rdinstrh";
if (instr_fence) new_ascii_instr = "fence";

if (instr_getq) new_ascii_instr = "getq";
if (instr_setq) new_ascii_instr = "setq";
Expand Down Expand Up @@ -1083,6 +1085,7 @@ module picorv32 #(

instr_ecall_ebreak <= ((mem_rdata_q[6:0] == 7'b1110011 && !mem_rdata_q[31:21] && !mem_rdata_q[19:7]) ||
(COMPRESSED_ISA && mem_rdata_q[15:0] == 16'h9002));
instr_fence <= (mem_rdata_q[6:0] == 7'b0001111 && !mem_rdata_q[14:12]);

instr_getq <= mem_rdata_q[6:0] == 7'b0001011 && mem_rdata_q[31:25] == 7'b0000000 && ENABLE_IRQ && ENABLE_IRQ_QREGS;
instr_setq <= mem_rdata_q[6:0] == 7'b0001011 && mem_rdata_q[31:25] == 7'b0000001 && ENABLE_IRQ && ENABLE_IRQ_QREGS;
Expand Down Expand Up @@ -1158,6 +1161,8 @@ module picorv32 #(
instr_sra <= 0;
instr_or <= 0;
instr_and <= 0;

instr_fence <= 0;
end
end

Expand Down
2 changes: 1 addition & 1 deletion pythondata_cpu_picorv32/verilog/picosoc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ clean:
rm -f testbench.vvp testbench.vcd spiflash_tb.vvp spiflash_tb.vcd
rm -f hx8kdemo_fw.elf hx8kdemo_fw.hex hx8kdemo_fw.bin cmos.log
rm -f icebreaker_fw.elf icebreaker_fw.hex icebreaker_fw.bin
rm -f hx8kdemo.blif hx8kdemo.log hx8kdemo.asc hx8kdemo.rpt hx8kdemo.bin
rm -f hx8kdemo.json hx8kdemo.log hx8kdemo.asc hx8kdemo.rpt hx8kdemo.bin
rm -f hx8kdemo_syn.v hx8kdemo_syn_tb.vvp hx8kdemo_tb.vvp
rm -f icebreaker.json icebreaker.log icebreaker.asc icebreaker.rpt icebreaker.bin
rm -f icebreaker_syn.v icebreaker_syn_tb.vvp icebreaker_tb.vvp
Expand Down
2 changes: 1 addition & 1 deletion pythondata_cpu_picorv32/verilog/scripts/cxxdemo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ CXX = $(RISCV_TOOLS_PREFIX)g++
CC = $(RISCV_TOOLS_PREFIX)gcc
AS = $(RISCV_TOOLS_PREFIX)gcc
CXXFLAGS = -MD -Os -Wall -std=c++11
CCFLAGS = -MD -Os -Wall -std=c++11
CFLAGS = -MD -Os -Wall -std=c++11
LDFLAGS = -Wl,--gc-sections
LDLIBS = -lstdc++

Expand Down

0 comments on commit 3b15922

Please sign in to comment.