Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
ECE 477 Digital Systems Senior Design Project Fall 2008 Homework 9: Software Design Considerations Due: Friday, October 31, at NOON Team Code Name: ECE Grande Group No. 3 Team Member Completing This Homework: Leo Romanovsky E-mail Address of Team Member: [email protected] Evaluation: SCORE DESCRIPTION Excellent – among the best papers submitted for this assignment. Very few corrections needed for version submitted in Final Report. Very good – all requirements aptly met. Minor additions/corrections needed for 9 version submitted in Final Report. Good – all requirements considered and addressed. Several noteworthy 8 additions/corrections needed for version submitted in Final Report. Average – all requirements basically met, but some revisions in content should 7 be made for the version submitted in the Final Report. Marginal – all requirements met at a nominal level. Significant revisions in 6 content should be made for the version submitted in the Final Report. Below the passing threshold – major revisions required to meet report * requirements at a nominal level. Revise and resubmit. * Resubmissions are due within one week of the date of return, and will be awarded a score of “6” provided all report requirements have been met at a nominal level. 10 Comments: ECE 477 Digital Systems Senior Design Project Fall 2008 1.0 Introduction The ECE Grand is an integrated No-Limit Texas Hold’em Poker Table system capable of managing user balance, login authentication and publishing of an ongoing game’s status to a webpage. A user interface allows players to interact with the game and receive information about their hands, balances, state of the community cards and various messages. The wide range of peripherals and complex application logic drives many of the design considerations and constraints, the details of which are discussed in the remainder of this report. 2.0 Software Design Considerations Narrowing down the software design considerations began with a thorough analysis of the project’s functional requirements and use cases. The biggest challenge of the project is the distributed nature of the computing workflow. The multitier architecture necessary to support interaction between the master and its slaves required careful consideration of each node’s place within the system. The system will support a number of external peripherals and, therefore, system resources, in order to interface them. The first, the RFID reader, communicates with the Master through a SCI channel. The second peripheral attached to the Master is the RJ-45 Ethernet jack, and this is driven by four IO pins. Communication between Slaves and the Master is achieved by over SPI network. On the Slave, user input is handled by IO pins and the LCD data and commands are transmitted over a parallel bus. Out of our functional and resources analysis, the decision to employ an interrupt driven software structure for both the slave and master was made because of the large number of supported peripherals. A polling-loop structure would have had the benefit of software simplicity but may have cause acceptable latency between tasks. The facility for debugging and testing is crucial to the success of the project for both smooth development as well as the demonstration of project success criteria. With this in mind, we make -1- ECE 477 Digital Systems Senior Design Project Fall 2008 extensive use of Metrowerks CodeWarrior Processor Expert, centralized software resets and power-on self tests. By using CodeWarrior’s PE utility, we ensure that all initialization and low level hardware interaction is handled by the IDE. In addition to this, CodeWarrior’s Simulator allows for real-time code step-through, breakpoint addition and data monitoring. This has already proven to be a great asset for tracking down software problems. The other major component of our debugging strategy is to ensure that all peripherals are fully functional whenever the system is booted up. We aim to accomplish this by a step-wise reset, beginning with the master and snaking out to the edges of the system. A master has the capability to reset each slave individually, which upon reset, are in turn able to reset their associated LCD’s, thus insuring that all major components, particularly user facing functions, are at a satisfactory level of operation. Software Design Narrative System Enter Game «uses» «uses» Play Game «uses» Player Leave Game Figure 1: System level use cases In order to adequately capture our software requirements, both user as well as component centric views were considered. Design began with a thorough analysis of various user interactions, before considering the implications of each on the underlying hardware. -2- ECE 477 Digital Systems Senior Design Project Fall 2008 At the lowest level are the peripheral drivers for the LCD and RFID reader. Each of these provides an interface between the hardware and the system in order to ease the development of software layers higher in the system stack. Both the RFID and LCD drivers are undergoing hardware testing. The end goal for the LCD driver is to not only be able to provide an interface between the system and the device, but to contain a nontrivial graphics library in order to allow for easier development of simple card representations and text. The LCD driver this ties into a brief discussion on the user GUI. In order to adequately provide players with the necessary information to play a game of poker, the LCDs must display a player’s two unique cards, their balance as well as some options for their possible actions. The embedded web server [2] [4] is a largely standalone module integrated with the rest of the system in order to provide the desired functional of publishing a webpage to attached clients. The core functionality is provided with the open source OpenTCP library, a small footprint implementation of the TCP/IP protocol aimed at microcontrollers. While lightweight, it is robust and provides an API at the device driver, socket and application levels. Although the library supports both TCP and UDP connections, we will only be making use of client requests of TCP. A successful client to server ping was demonstrated on hardware recently. Between the application logic and hardware drivers resides the integration software. While not an explicitly defined region, it is nonetheless a useful final abstraction for tasks needing to make use of more than one peripheral, and as always to reduce the development costs of the application logic. One of the primary uses for this layer is to provide an interface between the master and slave microcontrollers beyond basic SPI drivers. Although the exact protocol is undeveloped, there is an understanding of the data transmission needs between the devices and at what points it should occur, with this module ultimately helping to format those packets appropriately. This layer is in the pseudocode stage. At the highest level of software in our system resides the application logic required to manage a poker game. This layer differs dramatically between that present on the master and slaves. The master will need to perform actions such as deal the proper number of cards to the right players, manage valid betting (and other user actions) and decide on each rounds winner, -3- ECE 477 Digital Systems Senior Design Project Fall 2008 among other things. Naturally, this layer benefits from being able to have access to highly abstracted hardware and peripheral models, such as those residing below it. The slave, however, will be required to perform as much computation as possible internal to minimize the traffic on the SPI lines. Deciding which actions need additional resources is the primary function of this layer on the slave. For example, simple updates to the user menu can be refreshed locally. The current development is in the pseudocode stage. 3.0 Summary This report detailed the software design constraints of the ECE Grand project, as well as a thorough description of the purpose and function of each major software component. The state of driver development is progressing, while the development of the application and integration logic is proceeding in parallel. Developing the report serves as a good tool for both outside evaluators as well as being helpful to the team itself to consider details of the software that were not previously considered. -4- ECE 477 Digital Systems Senior Design Project Fall 2008 List of References [1] “CFAL12864L-Y-B2,” CrystalFontz, 10/03/2008. [Online] Available: http://www.crystalfontz.com/products/product.phtml/CFAL12864L-YB2.html?partname=CFAL12864L-Y-B2 [Accessed: October 31, 2008]. [2] “OpenTCP” SourceForge. [Online]. Available: http://sourceforge.net/projects/opentcp/. [Accessed: October 31, 2008]. [3] “RFID Reader Module,” Parallax. [Online]. Available: http://www.parallax.com/dl/docs/prod/audiovis/RFID-Reader-v1.1.pdf. [Accessed: October 31, 2008]. [4] S. Torres. "Web Server Development with MC9S12NE64 and OpenTCP," AN2836, Freescale Semiconductor, 9/2004. [Online]. Available: http://www.freescale.com/files/microcontrollers/doc/app_note/AN2836.pdf. [Accessed: October 31, 2008]. -5- ECE 477 Digital Systems Senior Design Project Appendix A: Flowchart/Pseudo-code for Main Program Start Initialization Start New Game and Wait for Enough Players Assign Dealer Chip, Big Blind and Small Blind Deal Player Cards Game Play Deal Community Cards Deal River Card Game Play Deal Turn Card Game Play Game Play Decide Winner Update Balances Allow Time for New Players to Join Return to Start Figure 2: System level flowchart -6- Fall 2008 ECE 477 Internal Initialization Digital Systems Senior Design Project Verify LCD Operation Enter Main Program Loop Master Interrupt Process Command Fall 2008 User Interrupt Request Additional Resources from Master Update Display yes Transmit to Master? no Update Display Figure 3: Slave Operation -7- Process User Input ECE 477 Digital Systems Senior Design Project Fall 2008 Appendix B: Hierarchical Block Diagram of Code Organization Application Logic User Interaction Integration Software LCD Driver LCD Web Server RFID Driver Server Application Logic RFID Reader Figure 4: Software Organization -8- openTCP Library