计组实验2报告

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Your goal is to modify(修改)your copy of bits.c so that it passes all the

tests in btest without violating(违反)any of the coding guidelines.(编码指南)

*********

0. Files:

*********

Makefile - Makes btest, fshow, and ishow

README - This file

bits.c - The file you will be modifying and handing in

bits.h - Header file

btest.c - The main btest program

btest.h - Used to build btest

decl.c - Used to build btest

tests.c - Used to build btest

tests-header.c- Used to build btest

dlc* - Rule checking compiler binary (编译器的二进制)(data lab compiler)9实验数据编译器)

driver.pl* - Driver program that uses btest and dlc to autograde bits.c

Driverhdrs.pm - Header file for optional "Beat the Prof" contest

fshow.c - Utility for examining floating-point representations

ishow.c - Utility(实用,通用)for examining integer representations

***********************************************************

1. Modifying bits.c and checking it for compliance(服从)with dlc

***********************************************************

IMPORTANT: Carefully read the instructions(说明)in the bits.c file before

you start. These give the coding rules(编码规则)that you will need to follow if

you want full credit(学分).

Use the dlc compiler(编译器)(./dlc) to automatically(自动的)check your version(版本)of

bits.c for compliance(服从)with the coding guidelines:

unix> ./dlc bits.c

dlc(数据链路控制)returns silently if there are no problems with your code.

Otherwise it prints(打印)messages that flag any problems. Running dlc with

the -e switch:

unix> ./dlc -e bits.c

causes dlc to print counts of the number of operators(运算符)used by each function.

Once you have a legal solution, you can test it for correctness using

the ./btest program.

*********************

2. Testing with btest

*********************

The Makefile in this directory compiles your version of bits.c with

additional code(辅助码,补码)to create a program (or test harness) named btest.

To compile and run the btest program, type:

unix> make btest

unix> ./btest [optional cmd line args]

You will need to recompile(重新编译)btest each time you change your bits.c

program. When moving from one platform(平台)to another, you will want to

get rid of the old version of btest and generate a new one. Use the

commands:

unix> make clean

unix> make btest

Btest tests your code for correctness by running millions of test

cases on each function. It tests wide swaths around well known corner

cases such as Tmin and zero for integer puzzles, and zero, inf(无穷大), and

the boundary(边界)between denormalized(非规划的)and normalized numbers for floating point puzzles. When btest detects(发现)an error in one of your functions,

it prints out the test that failed, the incorrect result, and the

expected result, and then terminates the testing for that function.

Here are the command line options for btest:

unix> ./btest -h

Usage: ./btest [-hg] [-r ] [-f [-1|-2|-3 ]*] [-T

-1 Specify first function argument

-2 Specify second function argument

-3 Specify third function argument

-f Test only the named function

-g Format output for autograding with no error messages

-h Print this message

-r Give uniform weight of n for all problems

相关文档
最新文档