瀏覽代碼

Fix up deliver script

master
peteraa 6 年之前
父節點
當前提交
559a5c8360
共有 3 個檔案被更改,包括 16 行新增6 行删除
  1. +5
    -3
      deliver.sh
  2. +9
    -0
      exercise.org
  3. +2
    -3
      src/test/scala/RISCV/Parser.scala

+ 5
- 3
deliver.sh 查看文件

@@ -3,23 +3,25 @@
read -p "Enter your student username (the one you use on badboard): " username
echo "Cleaning your project"

./sbt.sh clean
# ./sbt.sh clean

echo "Creating archive"
mkdir wrap
mkdir wrap/project
cp -r src ./wrap/
cp build.sbt ./wrap
cp project/Dependencies.scala ./wrap/project/Dependencies.scala
cp project/build.properties ./wrap/project/build.properties
cp sbt.sh ./wrap
tar czfv $username.gz wrap
(cd ./wrap/; tar czfv $username.gz .)
mv ./wrap/$username.gz .

rm -rf ./wrap

echo "Unwrapping and testing your wrapped package"
mkdir wrapTest
tar -C ./wrapTest -xvf $username.gz
./wrapTest/wrap/sbt.sh test
./wrapTest/sbt.sh test
rm -rf ./wrapTest

echo "If the test output looked good then you're good to go!"

+ 9
- 0
exercise.org 查看文件

@@ -22,6 +22,15 @@
Keep in mind that this is just a high level sketch, omitting many details as well
entire features (for instance branch logic)

*Important*
When you are done, use the provided ./deliver.sh script to pack up the archive.
If you're unable to run bash scripts then please ensure that you deliver a *zip* archive.
Not .rar or anything else, just use zip because my grading script knows how to handle that
in addition to the one used by deliver.sh
named after your username. Nothing more, nothing less, just your username.
This archive should be runnable as is, thus you need to include all the necessary files.
(I may or may not diff the tests to check if you're screwing with them)

#+CAPTION: A very high level processor schematic. Registers, Instruction and data memory are already implemented.
[[./Images/FiveStage.png]]


+ 2
- 3
src/test/scala/RISCV/Parser.scala 查看文件

@@ -26,7 +26,7 @@ object Parser {
def branchZ : (Parser[Int], Parser[String]) = (reg <~ sep, label)

def arith : (Parser[Int], Parser[Int], Parser[Int]) = (reg <~ sep, reg <~ sep, reg)
def arithImm : (Parser[Int], Parser[Int], Parser[Int]) = (reg <~ sep, reg <~ sep, hex | int)
def arithImm : (Parser[Int], Parser[Int], Parser[Int]) = (reg <~ sep, reg <~ sep, (hex | int))

def stringWs(s: String) : Parser[String] = many(whitespace) ~> string(s) <~ many1(whitespace)

@@ -144,7 +144,6 @@ object Parser {


val multipleInstructions: Parser[List[Op]] = List(
// stringWs("li") ~> (reg <~ sep, (hex | int).map(_.splitLoHi(20))).mapN{ case(rd, (hi, lo)) => {
stringWs("li") ~> (reg <~ sep, (hex | int).map(_.splitHiLo(20))).mapN{ case(rd, (hi, lo)) => {
say("hello?")
List(
@@ -155,7 +154,7 @@ object Parser {
// NOTE: THESE ARE NOT PSEUDO-OPS IN RISC-V32I!
// NOTE: USES A SPECIAL REGISTER
// NOTE: PROBABLY BROKEN, NOT EXHAUSTIVELY TESTED!!!
stringWs("lh") ~> (reg <~ sep, int <~ char('('), reg <~ char(')')).mapN{
stringWs("lh") ~> (reg <~ sep, (hex | int) <~ char('('), reg <~ char(')')).mapN{
case (rd, offset, rs1) if (offset % 4 == 3) => {
val placeHolder = if(rd == Reg("a0").value) Reg("a1").value else Reg("a0").value
List(


Loading…
取消
儲存