Skip to content

fukatani/systemverilog2verilog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

systemverilog2verilog

Converting systemverilog code to verilog code.

Introduction

systemverilog2verilog is coverter of systemverilog to verilog.

The script is aimed to preprocess systemverilog for a software (e.g. pyverilog, pyverilog_toolbox, pyeda, ...) that does not correspond to the systemverilog.

Software Requirements

  • Python (2.7)

Installation

git clone https://github.com/fukatani/systemverilog2verilog.git

Usage

python sv2v.py systemverilog-file-name.sv

You will get systemverilog-file-name.v.

Features

logic: Convert to reg or wire.

bit: Convert to reg or wire.

byte: Convert to reg [7:0] or wire [7:0] .

enum: Expand to localparam.

e.g.

enum logic [2:0] {PINK,GREEN,YELLOW=5,BLUE} color_e;

->

localparam PINK = 'd 0 ;localparam GREEN = 'd 1 ;localparam YELLOW = 'd 5 ;localparam BLUE = 'd 6 ;

(.*) port assign: Expand to assignment using port name.

clocking-endcloclking, property-endproperty, sequence-endsequence block: Delete all sentence.

default, assert: Delete line.

always_comb-> always @*

always_latch-> always @*

always_ff-> always

int-> integer

shortint-> reg signed [15:0]

longint-> reg signed [63:0]

'0-> 'd0

'1-> hffff

parameter logic-> parameter

localparam logic-> localparam

function logic-> function

Unimplemented:

interface (may be addressed in the future.)

struct (may be addressed in the future.)

union

License

Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)

Copyright

Copyright (C) 2015, Ryosuke Fukatani

About

Converting systemverilog to verilog.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published