Skip to content

Commit

Permalink
Initialize
Browse files Browse the repository at this point in the history
  • Loading branch information
colinlin committed Jul 2, 2020
0 parents commit abd219c
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Scratchip Binary CI
language: generic
env:
- VER=3.3.2 MILL_VERSION=0.7.3
before_deploy:
- curl --fail -L -o mill https://github.com/lihaoyi/mill/releases/download/$MILL_VERSION/$MILL_VERSION-assembly
- chmod +x mill
- wget https://github.com/freechipsproject/chisel3/archive/v$VER.zip
- unzip v$VER.zip
- cd chisel3-$VER
- ../mill chisel3[2.12.11].assembly
- mv out/chisel3/2.12.11/assembly/dest/out-tmp.jar chisel3-$VER.jar
- cd ..
- mkdir -p lib
- cp chisel3-$VER/chisel3-$VER.jar lib
- make verilog
- tar czvf cache.tar.gz .cache
deploy:
provider: releases
api_key: $GITHUB_TOKEN
file:
- lib/chisel3-$VER.jar
- cache.tar.gz
- mill
skip_cleanup: true
on:
tags: true
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export COURSIER_CACHE=.cache

verilog:
./mill chisel.run -td builds

20 changes: 20 additions & 0 deletions build.sc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import mill._, scalalib._
import ammonite.ops._
import java.nio.file.Paths

object chisel extends ScalaModule {
def scalaVersion = "2.12.6"
def scalacOptions = Seq(
"-Xsource:2.11",
)
def millSourcePath = super.millSourcePath / ammonite.ops.up

def unmanagedClasspath = T {
val lib_path = T.ctx.env.get("MILL_LIB") match {
case Some(lib) => Path(Paths.get(lib).toAbsolutePath)
case None => millSourcePath / "lib"
}
if (!ammonite.ops.exists(lib_path)) Agg()
else Agg.from(ammonite.ops.ls(lib_path).map(PathRef(_)))
}
}
20 changes: 20 additions & 0 deletions src/Top.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import chisel3._
import chisel3.util._

class Top extends Module {
val io = IO(new Bundle{})
/** Define your code here
*
val io = IO(new Bundle{
val sel = Input(UInt(1.W))
val in0 = Input(UInt(1.W))
val in1 = Input(UInt(1.W))
val out = Output(UInt(1.W))
})
io.out := (io.sel & io.in1) | (~io.sel & io.in0)
*/
}

object Main extends App {
Driver.execute(args, () => new Top)
}

0 comments on commit abd219c

Please sign in to comment.