• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

mit-plv/riscv-semantics: A formal semantics of the RISC-V ISA in Haskell

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

mit-plv/riscv-semantics

开源软件地址(OpenSource Url):

https://github.com/mit-plv/riscv-semantics

开源编程语言(OpenSource Language):

Haskell 60.7%

开源软件介绍(OpenSource Introduction):

riscv-semantics [Build Status]

Here lies a formal specification of the RISC-V ISA, written in Haskell. It is meant to serve many audiences.

First, it should be readable as documentation of the ISA, for, say, hardware and compiler engineers with no background in formal verification or functional programming. The next section suggests how such readers should get started.

Second, it should be executable as an oracle for test cases and so on. See the later sections here for build-and-run instructions.

Finally, people with sufficient Haskell background should be able to understand subtleties of the semantics and even extend with new features. More documentation for that class of users may be forthcoming!

How to Read this Spec

  1. Read the reading guide.
  2. Read the first half of our explanation of exception handling in the semantics.
  3. Dive into the Spec directory.

Installation Guide

Install Stack

This project uses stack to manage the Haskell compiler and the project's dependencies. Even though there is a package for stack that can be installed using apt (in Ubuntu et al.), it won't work due to known bugs in the version in the repository. To install stack, follow its official directions or run the following code in a Unix-based machine:

$ curl -sSL https://get.haskellstack.org/ | sh

Compile the Project

There is a Makefile with recipes to compile the project, the elf2hex utility, and all the tests. Building the tests requires a recent version of riscv-none-embed-gcc in your path. To build everything, run:

$ ./install.sh
$ make

If you do not have the compiler in your path, this command will fail. To install the compiler and add it to your path:

$ ./install_riscv_gcc.sh
$ . setup.sh

Simulating an Example Program

To simulate an example program, run the command

$ stack exec riscv-semantics test/build/thuemorse64

This invocation should produce the output

01101001100101101001011001101001100101100110100101101001100101101001011001101001011010011001011001101001100101101001011001101001

Run riscv-tests

To run the default 64-bit executable simulator on riscv-tests:

$ stack exec riscv-semantics-tests

Generation of Verilog (work in progress)

$ ./install-clash.sh
$ ./make-circuit.sh

The output will be in src/verilog.

To get rid of intermediate files created in the src folder:

$ ./clean-circuit.sh



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
ZHaskell/stdio: Haskell Standard Input and Output发布时间:2022-06-18
下一篇:
tanakh/hoe: Haskell One-liner Evaluator发布时间:2022-06-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap