462OJ Ver1.0 - 基于云服务器的CO自动化评测OJ平台

花米租服务器不易,欢迎大家前来品尝 :)

简介

使用c++,python等编程语言综合开发,能将verilog代码提交至远程服务器并自动评测输出结果

特点

  • 使用学长Toby Shi的魔改Mars对拍验证输出正确性

  • 无需在本地配置iverilog,python等环境,主打"拿来就用"

    • 未来将部署ISE,争取实现行为与课程平台一致
  • 提供更强的数据点以供评测

    • 保证每个数据点均能被正确执行,在此基础上增强数据强度

    • 当前版本由线下准备数据点,未来将把数据点生成任务集成至云服务器

  • 结合课程进度推进更新数据点

  • 每次测试后均删除上传代码,隐私得到保障

使用指南

准备文件

将全部.v文件(不包括testbench文件)打包至文件夹,文件夹名为{学号}_P4,注意将顶层文件模块名改为mips.v

1
2
3
4
5
6
.
|-- 2237xxxx_P4
| |-- mips.v
| |-- alu.v
| |-- grf.v
| |-- ......

上传文件

在终端(如cmd中)运行

其中“{}”不需要被打出,下同

1
scp -r {包含.v文件的文件夹绝对路径} stu{学号}@82.157.78.233:~

按照提示输入密码,等待文件上传成功

进行评测

在终端运行

1
ssh stu{学号}@82.157.78.233

按照提示输入密码,登录成功后运行指令

1
$ bash runP4.sh {学号}

即可进行评测并获得结果反馈

如果你已经会使用linux指令,那么这些对你来说都不是什么难事

查看评测结果

登录成功后运行

1
$ bash judgeP4.sh {学号}

可以查看最近一次的评测信息,默认不显示错误数据点的信息

需要查看所有错误数据点的信息,可以运行

1
$ bash judgeP4.sh {学号} all

需要查看第一个错误数据点的信息,可以运行

1
$ bash judgeP4.sh {学号} first

评测信息解读

对每一个测试点,评测机会返回AcceptedWrong AnswerOutput more than expectedOutput more than expected四种提示信息当中的一种,只有返回Accepted时才会评判为该数据点通过

$ bash runP4.sh {学号}的返回信息示例如下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
User ID: /home/ubuntu/ans/P4/2237xxxx
··············································
Case 1: Output less than expected. Matching rate is 0.9838018990876932.
Valid output(s): 94
··············································
Case 2: Output more than expected. Matching rate is 0.893569431500466.
Valid output(s): 98
··············································
Case 3: Wrong Answer. Matching rate is 0.5222513089005235.
Valid output(s): 107
··············································
Case 4: Accepted.
Valid output(s): 133
··············································
Case 5: Accepted.
Valid output(s): 57
··············································
Case 6: Accepted.
Valid output(s): 88
··············································
Case 7: Accepted.
Valid output(s): 46
··············································
Case 8: Accepted.
Valid output(s): 117
··············································
Case 9: Accepted.
Valid output(s): 51
··············································
Case 10: Accepted.
Valid output(s): 77
··············································
Test Accuracy: 7 / 10.

所有数据点通过,系统会额外返回Congratulations!

当出现错误数据点时,在firstall条件下,系统将打印你的输出与期望输出之间的差异文本,样例如下:

1
2
3
4
5
  @00003004: $ 5 <= 3f500000
- @00003008: $ 3 <= 00003f74
- @00003038: $20 <= 00000000
- @0000303c: $ 8 <= 00000000
@00003040: *00001924 <= 00003f74

表示你的输出比期望输出缺失所列三行;

1
2
3
4
5
  @0000303c: $30 <= 00000000
+ @00003040: $ 3 <= 00000000
+ @00003044: $25 <= 036c3744
+ @00003048: $13 <= 1f0c0000
@00003040: $ 3 <= 00000000

表示你的输出比期望输出多出所列三行;

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  @000030d8: $ 5 <= 00000000
- @000030dc: *000005d4 <= 00000000
? ^^^

+ @000030dc: *000005d4 <= 00000aaa
? ^^^

@000030e0: $ 5 <= 00000000
- @000030e4: $19 <= 01640000
+ @000030e4: $19 <= xxxxxxxx
- @000030e8: $17 <= 3b980000
? ^^

+ @000030e8: $17 <= 3b9800cc
? ^^

表示你的输出与答案存在差异。

其中,-标记的为期望输出,+标记的为你的输出,?^标记了你的输出与期望输出的不同。

获取账号

获取账号方式,请通过邮件fysszlr@qq.com或添加我微信和我联系(保证免费)

注意事项

请勿用本服务器进行任何与CO程序评测无关的事情!

包括但不限于把服务器当云盘用,用服务器来挖矿等!

最后

本项目灵感来自上学期myk学长写的简易数据结构oj

感谢zlr同学进行服务器框架搭建、评测文件编程等工作

感谢lpf同学进行测试数据点随机生成、验证正确性与强度等工作

感谢zxw同学进行机器码、测试点导出,文本对拍评测等工作

受开发者水平限制,本oj难免有许多问题,还请学长和同学不吝指教🙏

如有问题,请截图发送到此帖下,或联系管理员fysszlr@qq.com(22373425张栗瑞)