Skip to content

AliAlaa88/RISC-V-From-UDB-to-Implementations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧪 YAML Roundtrip Processor

This tool performs YAML file roundtripping using either ruamelyaml or pyyaml. It ensures the consistency of YAML parsing and serialization by verifying that the file remains the same across multiple parse-dump cycles.


🔧 Setup Instructions

📁 Directory Structure

  • Place all task files next to the riscv-unified-db directory (i.e., not inside it).
  • The test_cases folder (attached) contains the expected output files generated from the scenarios below.

🐍 Environment

  • Python version: 3.13
  • OS: Ubuntu 24.04 or Windows 11

▶️ How to Run

Run the main Python script run.py using one of the following commands:

python3 run.py                   # Uses ruamelyaml by default
python3 run.py ruamelyaml       # Explicitly uses ruamelyaml
python3 run.py pyyaml           # Uses pyyaml instead

📝 Optional Arguments

You can optionally provide:

  1. Output file name
  2. Original YAML input file path

Examples:

# Uses hardcoded original file, custom output name
python3 run.py ruamelyaml output1

# Uses custom input and output
python3 run.py ruamelyaml output2 output1.yaml

✅ Complete Test Scenario

# Step 1: Run on original YAML
python3 run.py ruamelyaml output1 riscv-unified-db/spec/std/isa/proc_cert_model/MockProcessor.yaml

# Step 2: Run again using the first output as input
python3 run.py ruamelyaml output2 output1.yaml

# Step 3: Validate outputs
# Files: MockProcessor.yaml, output1.yaml, output2.yaml
# ✅ All should be identical

🧪 Test Cases (With Attached Results)

Test Case 1

python3 run.py ruamelyaml output1 riscv-unified-db/spec/std/isa/inst/B/andn.yaml
python3 run.py ruamelyaml output2 output1.yaml

Test Case 2

python3 run.py ruamelyaml output1 riscv-unified-db/spec/std/isa/inst/mock.yaml
python3 run.py ruamelyaml output2 output1.yaml

Test Case 3 (Using Hardcoded Defaults)

python3 run.py ruamelyaml output1
python3 run.py ruamelyaml output2 output1.yaml

About

RISC-V From UDB to Implementations Coding Challenge

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors