00001 /*************************************************************************** 00002 * Copyright (C) 2005 by David Saxton * 00003 * david@bluehaze.org * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 ***************************************************************************/ 00010 00011 #ifndef RAM_H 00012 #define RAM_H 00013 00014 #include "component.h" 00015 #include "logic.h" 00016 00017 #include <qbitarray.h> 00018 #include <qptrvector.h> 00019 00023 class RAM : public CallbackClass, public Component 00024 { 00025 public: 00026 RAM( ICNDocument *icnDocument, bool newItem, const char *id = 0 ); 00027 ~RAM(); 00028 00029 virtual bool canFlip() const { return true; } 00030 static Item * construct( ItemDocument *itemDocument, bool newItem, const char *id ); 00031 static LibraryItem * libraryItem(); 00032 00033 protected: 00034 void initPins(); 00035 virtual void dataChanged(); 00036 void inStateChanged( bool newState ); 00037 00038 QBitArray m_data; 00039 LogicIn * m_pCS; // Chip select 00040 LogicIn * m_pOE; // Output enable 00041 LogicIn * m_pWE; // Write enable 00042 00043 int m_wordSize; 00044 int m_addressSize; 00045 00046 QPtrVector<LogicIn> m_address; 00047 QPtrVector<LogicIn> m_dataIn; 00048 QPtrVector<LogicOut> m_dataOut; 00049 }; 00050 00051 #endif
1.5.1