Code associated with "Control Embedded Projects with Software Requirements Specs" by Orv Balcom, February 1997 Listing 1: LCD display specification Multiline LCD displays are one of the more common forms of embedded system output. Fancy graphics arenีt needed to specify them, only theIBM PC graphics set. The following example tells the programmer exactly what is needed: Date Entry Display T o d a y ิ s d a t e i s : _ _ / _ _ / _ _ _ _ P l e a s e c o r r e c t a n d p r e s s E N T E R . 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 Listing 2: Write it once It is important that the SRS detail specific requirements in only one place. These details should be included in other sections by reference so if they change, there is no possibility that one instance of the requirement is changed and another copy is not. For example if Section 3 contained the following paragraph: 3.1.2.35 SCI Control Register 2. The SC1 Control Register, SCCR2, is a write only register used to control the SCI. All bits are not used by the program and should be maintained in their initialized state. Bit Mnem. Inital. Function to D7 TIE ิ0ี Disable transmit interrupt D6 TCIE ิ0ี Disable transmit complete int. D5 RIE ิ0ี Disable receive interrupt D4 ILIE ิ0ี Disable idle interrupt D3 TE ิ1ี Enable transmit D2 RE ิ1ี Enable receiver D1 RWU ิ0ี Disable receiver wake-up D2 SBK ิ0ี Disable send break The function of the applicable bits are as follows: Bit Value Function TIE ิ0ี Disable transmit interrupt. ิ1ี Enable transmit interrupt. TCIE ิ0ี Disable transmit complete interrupt. ิ1ี Enable transmit complete interrupt. TE ิ0ี Disable transmitter. ิ1ี Enable transmitter. RE ิ0ี Disable receiver. ิ1ี Enable receiver. Section 5 could then include the statement: The SCI Control Register, SCCR2, shall be initialized per Paragraph 3.1.2.35. Listing 3: Tracking the variables Many formats for SRSs require complete descriptions of passed variables at the beginning and end of each Section. I feel this violates my Write It Once policy. I show the source or destination of a variable in each Section and then describe the variable in a data dictionary in Section 9. The following shows how the integer variable array, MaxTemp(), is computed in Section 6 and passed to Section 8 for output. Output from Section 6 is passed to Section 8: Table 6.4-1 Input Processing Data Outputs Item Dest. Function MaxTemp(i) 8.2 Maximum sensor temperature array MaxTemp array is received by Section 8 for output processing: Table 8.2-1 Output Generation Data Inputs Item Source Function MaxTemp(i) 6.4 Maximum sensor temperature array Variable MaxTemp is specified as to scale factor and range in Section 9. By scale factor, I mean the value in engineering units associated with the machine representation of the variable. For a floating point number, this would be the units, such as pounds or degrees F. For fixed point, it is the largest value of the engineering units representable by the variable. Table 9.0-1 Global Data Description Data Name Description Scale Factor Range Type Modified by Used by MaxTemp(i) Maximum sensor temperature array 6553.6 Deg K 0-6553.5 5 X 16 bit unsigned 6.4 8.2