qpcpp_5.3.1
所属分类:VHDL/FPGA/Verilog
开发工具:Visual C++
文件大小:25204KB
下载次数:10
上传日期:2015-05-09 22:47:49
上 传 者:
huigang
说明: 学习QP的范例,可以非常好的应用自己的程序上,非常好的状态机模型.
(Learning QP example, it can be very good application on their own procedures, very good state machine model.)
文件列表:
qpcpp\COPYING (1046, 2014-09-22)
qpcpp\doc\AN_QL_Coding_Standard.pdf (492797, 2014-09-22)
qpcpp\doc\AN_QP-C_MISRA.pdf (605222, 2014-09-22)
qpcpp\doc\AN_QP_and_ARM-Cortex-M-ARM-KEIL.pdf (1435125, 2014-09-22)
qpcpp\doc\AN_QP_and_ARM-Cortex-M-GNU.pdf (1315234, 2014-09-22)
qpcpp\doc\AN_QP_and_ARM-Cortex-M-IAR.pdf (1370719, 2014-09-22)
qpcpp\doc\AN_QP_and_POSIX.pdf (843970, 2014-09-22)
qpcpp\doc\AN_QP_and_Win32.pdf (1581999, 2014-09-22)
qpcpp\doxygen\Doxyfile (103121, 2014-09-22)
qpcpp\doxygen\Doxyfile-CHM (103121, 2014-09-22)
qpcpp\doxygen\footer.html (647, 2014-09-22)
qpcpp\doxygen\header.html (1969, 2014-09-22)
qpcpp\doxygen\html (0, 2014-09-22)
qpcpp\doxygen\images\logo_ql_TM.jpg (12642, 2014-09-22)
qpcpp\doxygen\images\logo_qp_200x55.png (18762, 2014-09-22)
qpcpp\doxygen\images\logo_qp_60x55.jpg (3055, 2014-09-22)
qpcpp\doxygen\images\PSiCC2_250x200.jpg (18189, 2014-09-22)
qpcpp\doxygen\images\qp_banner.jpg (33779, 2014-09-22)
qpcpp\doxygen\images\qp_components.jpg (27823, 2014-09-22)
qpcpp\doxygen\make.bat (2758, 2014-09-22)
qpcpp\doxygen\qpcpp.txt (13786, 2014-09-22)
qpcpp\doxygen\qpcpp_metrics.txt (191369, 2014-09-22)
qpcpp\doxygen\qpcpp_rev.txt (65727, 2014-09-22)
qpcpp\doxygen\qp_macros.h (6128, 2014-09-22)
qpcpp\doxygen\rsm.bat (2095, 2014-09-22)
qpcpp\doxygen\rsm_qpcpp.cfg (24929, 2014-09-22)
qpcpp\doxygen\snippets\qep_qevt.cpp (117, 2014-09-22)
qpcpp\doxygen\snippets\qep_qfsm.cpp (547, 2014-09-22)
qpcpp\doxygen\snippets\qep_qfsm_use.cpp (471, 2014-09-22)
qpcpp\doxygen\snippets\qep_qhsm.cpp (659, 2014-09-22)
qpcpp\doxygen\snippets\qep_qhsm_use.cpp (443, 2014-09-22)
qpcpp\doxygen\snippets\qep_qinit.cpp (710, 2014-09-22)
qpcpp\doxygen\snippets\qep_qmsm.cpp (781, 2014-09-22)
qpcpp\doxygen\snippets\qep_qtran.cpp (681, 2014-09-22)
qpcpp\doxygen\snippets\qf_ctor.cpp (233, 2014-09-22)
qpcpp\doxygen\snippets\qf_main.cpp (1832, 2014-09-22)
qpcpp\doxygen\snippets\qf_post.cpp (498, 2014-09-22)
qpcpp\doxygen\snippets\qf_postx.cpp (570, 2014-09-22)
qpcpp\doxygen\snippets\qf_qactive.cpp (567, 2014-09-22)
qpcpp\doxygen\snippets\qf_run.cpp (421, 2014-09-22)
... ...
What's New?
===========
Scroll down a bit to the section "QP/C++ Revision History".
Installing QP/C++
=================
QP/C++ can be unzipped anywhere in your file system, but the recommended
location is C:\qp\qpcpp on Windows and ~/qp/qpcpp on Linux/MacOS-X.
The Generally Available QP/C++ release contains the QP/C++ source code
(independent on any particular processor or compiler), detailed "QP/C++
Reference Manual" in CHM, and a "Getting Started" guide in PDF that
explains step-by-step how to build a simple Blinky application with QP/C++.
Also, the Generally Available release of QP/C++ contains ports and
examples for ARM Cortex-M as well as ports and examples for desktop
systems (Windows, Linux/POSIX), which you can run without any embedded
targets.
Defining the QPCPP Environment Variable
=======================================
The project files and Makefiles provided in the "examples" directory
assume that the environment variable QPCPP is defined and it points to
the location of the QP/C++ framework. For example, assuming that you
have installed QP/C++ into the directory C:\qp\qpcpp, you should define
the environment variable QPC to C:\qp\qpcpp.
Additionally, the provided Makefiles for win32\mingw (Windows with MinGW
GNU-based compiler) assume that the MinGW toolset is available. The
MinGW toolset is now part of the Qtools collection for Windows, which
should be unzipped to your disk and added to the PATH. For example,
assuming that you have the Qtools collection into the C:\tools\qtools\
directory, please make sure that your PATH contains C:\tools\qtools\bin.
Editing the Environment Variables on Windows
--------------------------------------------
Open the Windows Explorer and right-click on the Computer icon. Then
select Properties from the pop-up menu. This opens a window with the
basic information about your computer. In the left panel of this window,
click on "Advanced system settings". This opens the dialog "System
Properties". Click the "Environment Variables..." button.
To add a new environment variable, click the "New..." button in the
System Variables section and provide the variable name (e.g., QPCPP) and
value (e.g., C:\software\qpcpp).
To modify the Path variable, look in the bottom panel "System Variables"
and scroll down to find the variable Path. Click on it and then press
"Edit..." button. Click on the Variable value edit field. At the end of
the string append ;C:\tools\qtools\bin (assuming that you have installed
the Qtools collection in C:\tools\qtools). Make sure that there is a
semicolon ';' between the last entry and the added path.
Editing the Environment Variables on Linux and Mac OS X
-------------------------------------------------------
You need to edit the ~/.bash_profile file (~/.profile in some systems)
to add the following lines:
export QPCPP=~/qp/qpcpp
export QTOOLS=~/tools/qtools
assuming that you have installed QP/C++ into ~/qp/qpcpp and Qtools into
~/tools/qtools, respectively.
QP/C++ Development Kits (QDKs)
==============================
The QP/C++ Baseline Code usually needs to be adapted to various
operating systems, microprocessors, and compilers. Adapting the QP
software is called porting and QP has been designed from ground up to
make the porting easy.
A large and steadily growing number of QP/C++ Development Kits (QDKs)
for popular processors (such as ARM Cortex-M, ARM7/ARM9,TI MSP430, TI
TMS320C28x, TMS320C55x, Atmel AVR and AVR32, Renesas RX, M16C/R8C,
Microchip PIC24/dsPIC, PIC32) and operating systems (such as Linux/BSD,
Windows/WinCE, VxWorks, ThreadX, uC/OS-II, eCos) are available for
download from SourceForge.net:
http://sourceforge.net/projects/qpcpp/files
Please keep checking this website, as QDKs are updated and added frequently.
All QDKs are designed to "plug-into" the directory structure already
established after the installation of the QP/C++ baseline code. In other
words, you need to install the QP baseline code, before you install any QDK.
Contact information:
====================
Web: http://www.state-machine.com
Email: info@state-machine.com
#######################################################################
################### QP/C++ Revision History ###########################
QP/C++ Version 5.3.1 (20-Sep-2014)
----------------------------------
****
NOTE: QP/C++ 5.3.1 remains backwards-compatible with all QP/C++ 5.x.y
ports and applications
****
This release fixes the following bugs:
1. QMsm::isInState() returns invalid result (bug #105)
2. QF::gc() doc typo (bug #102)
3. POSIX-port Makefile error (bug #65)
4. Problematic friendship to extern "C" function in qf.h (bug #106)
Also, this release updates the PC-Lint options and removes all the
remaining PC-Lint warnings for the latest PC-Lint 9.00k.
Additionally, this release improves the uC/OS-II port in that it is now
generic and applicable for any CPU, for which uC/OS-II port exists.
Specifically, all references to DOS or x86 have been removed from the QP
port and any CPU-specific dependencies have been placed in the separate
part of the port.
Finally, this release improves the "QP/C++ Reference Manual" generated
by Doxygen and available both inside the QP/C++ baseline distribution
(qpcpp.chm file) and online at: http://www.state-machine.com/qp/qpcpp
QP/C++ Version 5.3.0 (2014-04-14)
---------------------------------
This release adds the "transition to history" (deep history) feature to
both QHsm and QMsm state machines and their subclasses. This QP/C++
release matches the new QM modeling tool version 3.1.0, which now
supports the "transition to history" connector and the corresponding
code generation for transitions to history.
**** *
NOTE: QP/C++ 5.3.0 remains backwards-compatible with QP/C++ applications
developed for QP/C++ 4.x and QP/5.x. However, any QM models created for
the previous QP/C++ versions require re-generating the code with QM 3.1.0.
**** *
This release adds new QS (Quantum Spy) instrumentation for tracing
transitions to history as well as entry and exit points in submachines.
All these features require the matching QSPY host application included
in Qtools 5.3.0.
Additionally, the QMsm state machine has been extended to add
implementation of the reusable submachine states and submachines with
entry points and exit points. The reusable submachines in QP/C++ 5.3.0
lay the groundwork for providing reusable submachine states and
submachine diagrams in the next upcoming QM version.
This release also uses the C99 data types uint_fast8_t and uint_fast16_t
instead of the non-standard uint_t.
Finally, this QP/C++ release brings deep changes in the source code
comments and the doxygen documentation generated from the source code.
All comments have now more consistent structure, and every function is
now documented in the implementation file (.cpp file), whereas the
interface (.h files) contain only the brief descriptions of the
functions. This re-structuring of documentation is performed as part of
the validation and verification effort that has begun to provide a
certification package for QP/C++ for safety standards, such as IEC 61508
and ISO 62304 (FDA 510(k)).
Changes in detail:
1. Moved detailed documentation of functions from the header files (.h)
to implementation files (.cpp).
2. Removed the header file "qevt.h" and merged its contents into "qep.h"
3. Added macros: trace records QS_QEP_TRAN_HIST, QS_QEP_TRAN_EP, and
QS_QEP_TRAN_XP to "qs.h"
4. Added macros: Q_TRAN_HIST(), QM_TRAN_HIST(), QM_TRAN_EP(),
QM_TRAN_XP(), and QM_SUPER_SUB() to "qep.h"
5. Added attributes entryAction and initAction to the QMState struct in
"qep.h" (needed for transition to history).
6. Added attribute act to the QMAttr union in "qep.h" (needed for
transitions to entry point in submachine states).
7. Changed the QState return type from action/state handler functions to
uint_fast8_t.
8. Added QM models to the "Transition to History" design pattern example
(directory qpcpp\examples\win32\mingw\history) and also added an example
for "Transition to History" with the QMsm class (see
qpcpp\examples\win32\mingw\history_qm).
9. Changed the m_prio attribute of QActive to uint_fast8_t.
10. Changed the type of prio argument to uint_fast8_t and qlen/stkSize
to uint_fast16_t in the signature of QActiveVtbl.start function pointer
and QActive::start_() implementation.
11. Changed the type of the tickRate argument in QTimeEvt constructor
and QF::tickX_(), and QF::noTimeEvtsActiveX() to uint_fast8_t.
12. Changed the type of the poolSize argument in QF::poolInit() to
uint_fast16_t.
13. Changed arguments evtSize and margin in QF::newX_() to uint_fast16_t.
14. Changed attribute bits in QPSet8 as well as bytes and bits[] in
QPSet*** to uint_fast8_t.
15. Changed the QEQueueCtr event queue counter type to uint_fast8_t.
16. Changed type of arguments qLen and margin in QEQueue::init() and
QEQueue/QActive::post() to uint_fast16_t.
17. Changed the return type from QK_schedPrio_() (priority) as well as
the p argument in QK_sched_() and QK_schedExt_() to uint_fast8_t
18. Added function QMsm::isInState() to "qep.h" and its implementation
file qmsm_in.cpp. This function tests whether the QMsm state machine (or
its subclasses like QMActive) "is in" the given state.
19. Updated all make scripts for QP/C++ ports to include the new
qmsm_in.cpp in the QP/C++ library builds.
QP/C++ Version 5.2.1 (2014-01-06)
---------------------------------
This release fixes two bugs.
1. In file qmsm_dis.cpp added saving of the action-table into a
temporary variable *before* exiting the current state to the transition
source. Also, changed the signature of the QMsm::msm_tran() helper
function to take the action table as parameter. NOTE: This bug only
affected the Spy configuration and because of this escaped regression
testing. The internal testing process have been updated to test all
build configurations: Debug, Release, and Spy.
2. In file qs_mem.cpp fixed an error in accounting used bytes in the QS
trace buffer.
QP/C++ Version 5.2.0 (2013-12-28)
---------------------------------
This release matches the new QM 3.0.0, for which it provides model
examples based on the new QMsm/QMActive classes. This, in turn
demonstrates the new state machine code generation that QM3 was
specifically designed to do.
This release also provides a clearly separated API compatibility layer,
whereas you can configure a level of backwards compatibility by means of
the #QP_API_VERSION macro. This facilitates migrating existing QP
applications to the newer API.
An cyclomatic complexity (McCabe V(G)) analysis of this version has been
performed and the maximum V(G) complexity per function has been reduced
to 15 by breaking up the QHsm::dispatch() function. The code metrics
report, including cyclomatic complexity by function as well as other
standard code metrics (e.g., lines of code), is now included in the
"QP/C++ Reference Manual", see
http://www.state-machine.com/qp/qpcpp/metrics.html
Also, in this release all internal QP data that were previously
uninitialized are now explicitly initialized to zero. In other words,
this release no longer assumes that all uninitialized data (global and
static inside functions) is implicitly initialized to zero before the
control is transferred to main(). This is a requirement of the C
Standard, but some embedded startup code fails to do this.
Finally, this release demonstrates safer stack allocation and safer
exception handlers in all ARM Cortex-M examples. The techniques are
described in the Embedded.com article "Are We Shooting Ourselves in the
Foot with Stack Overflow?".
Changes in detail:
1. for backwards compatibility, in file qp_port.h defined "API
Compatibility Layer", which is controlled by the macro #QP_API_VERSION.
For example, specifying QP_API_VERSION=500 chooses API compatible with
QP version 5.0.0 or newer, but excludes APIs that became deprecated in
the earlier versions. If the macro #QP_API_VERSION is not defined by the
user (typically on the command line for the compiler), the default value
of 0 is assumed. This default means maximum backwards compatibility
(from version 0.0.0). On the other hand, higher values of
#QP_API_VERSION mean less backwards compatibility. For example
QP_API_VERSION=9999 will specify compatibility only with the latest
version of QP. The API Compatibility Layer for QP_API_VERSION < 500
provides macros: postLIFO(), publish(), and tick(). These macros resolve
to POST(), PUBLISH(), and TICK_X() respectively.
2. In file qhsm_dis.cpp, broken up the function QHsm::dispatch() into
two functions QHsm::dispatch() and a private helper QHsm::hsm_tran().
This has reduced the cyclomatic complexity from 25 for the original
function, to 11 and 15 for QHsm::dispatch_() and QHsm::hsm_tran(),
respectively.
3. In file qmsm_dis.cpp, broken up the function QMsm::dispatch() into
two functions QMsm::dispatch() and a private helper QMsm::msm_tran().
This has reduced the cyclomatic complexity from 15 for the original
function, to 9 and 7 for QMsm::dispatch() and QMsm::msm_tran(),
respectively.
4. Changed QM models dpp.qm and game.qm to use QMActive and QMsm base
classes instead of QActive and QHsm, to showcase the new code generation
capabilities of QM3.
5. Added the QMsmTst example application analogous to the QHsmTst to
test the QMsm base class. The QMsmTst comes with the QM model qmsmtst.qm.
6. In file qf_act.cpp added the function QF::bzero(), and in files
qvanilla.cpp and qk.cpp added calls to QF::bzero() to explicitly clear
the uninitialized data. Also added calls to QF::bzero() inside qf_psini.cpp.
7. Updated all examples for ARM Cortex-M to use safer stack allocation
and safer exception handlers in all ARM Cortex-M examples, as described
in the Embedded.com article "Are We Shooting Ourselves in the Foot with
Stack Overflow?".
QP/C++ Version 5.1.1 (2013-10-10)
---------------------------------
This release fixes reversal of logic in the QF::noTimeEvtsActiveX()
function as well as sleep mode transition in the ARM Cortex-M3/M4 ports
to the cooperative Vanilla kernel. Also, the native QP event queue
implementation has been changed to count the extra "front-event"
location into the number of free entries, which fixes the problem of
defer queues of depth 1. Finally, the release restores the support for
linting (with PC-Lint) of the QP/C++ applications for ARM Cortex-M (with
IAR and GNU compilers).
Changes in detail:
1. In file qf_tick.cpp reversed the logic inside QF::noTimeEvtsActiveX()
2. Modified free entry accounting (nFree) in the files: qeq_init.cpp,
qeq_fifo.cpp, qeq_get.cpp, and qeq_lifo.cpp.
3. Modified free entry accounting (nFree) in the files: qa_init.cpp,
qa_fifo.cpp, qa_get_.cpp, and qa_lifo.cpp.
4. Introduced new macro QF_CPU_SLEEP() in the ARM Cortex-M Vanilla ports.
5. Changed Board Support Package files (bsp.cpp) in the ARM Cortex-M
Vanilla examples.
6. Modified the CMSIS-compliant startup code in all ARM Cortex-M examples.
7. Modified the application examples with PC-Lint
(qpcpp\examples\arm-cm\qk\gnu\dpp-qk_ek-lm3s811-lint and
qpcpp\examples\arm-cm\qk\iar\dpp-qk_ek-lm3s811-lint). Updated lint files
for the latest PC-Lint
8. Ported all state pattern examples to Win32/MinGW. That way, all these
examples can be run and modified directly on Windows, without going back
to DOS.
QP/C++ Version 5.1.0 (2013-09-29)
---------------------------------
****
NOTE: QP/C++ 5.1.0 remains backwards-compatible with the existing
QP/C++ 4.x applications, except the ARM Cortex-M applications need to
adjust the interrupt priorities. Specifically, you need to set the
interrupt priorities equal or lower than QF_AWARE_ISR_CMSIS_PRI
constant provided in the qf_port.h header file.
****
The main purpose of this milestone QP/C++ release is to enable the QM
modeling tool to generate a new type of state machine code (requires QM
version 3.0.0, which is still in development as of this writing).
This new type of state machine implementation in QP/C++ 5 is based on
the new QMsm class, which takes advantage of the QM tool as an advanced
"state machine compiler". QM can perform optimizations that were not
possible with the C pre-processor alone. Specifically, the QM can easily
determine the LCA (Least-Common-Ancestor) state for every transition and
it can generate the complete transition-sequences (sequences of
exit/entry/initial actions) at code-generation time. The resulting code
can be still highly human-readable, but it will no longer be
human-maintainable. The lab tests indicate that the new "housekeeping"
code for executing hierarchical state machines can be about twice as
fast as the previous code based on the ::QHsm class.
The next important change introduced in QP/C++ 5 is making several
important functions in QP/C++ base classes virtual. The new virtual
functions include: QMsm::init() and QMsm::dispatch() and
QActive::start(), QActive::post(), and QActive::postLIFO() perations.
Making theses functions virtual means that all these operations can be
overridden in sub-classes of state machines and active objects. This, in
turn, allows a single application to use a mix of state machine classes
derived from the new QMsm base class with state machines derived from
the QHsm base class, each one using a different state machine
implementation strategy. Additionally, the virtual QActive::post()
operation could be very useful for implementing various Proxy active
objects (e.g., for active object event posting across networks).
Another big feature introduced in QP/C++ 5 are the multiple, independent
system clock tick rates for time events. The number of system tick rates
can be now configured in the QP/C++ ports. For example, a digital watch
can use a "fast" clock tick rate of 100Hz and a "slow" clock tick rate
of only 1Hz. These clock tick rates can be managed independently, so for
example, the fast clock tick rate can be shut down in the absence of
time events assigned to this rate. This feature allows the applications
to implement sophisticated power-saving policies.
As yet another important feature, QP/C++ adds a new "extended" API for
non-asserting event allocation and posting. This feature is intended for
situations, where an application is hammered with external events that
at times arrive too fast for processing, but that can be ignored under
the overload conditions. In those cases firing an assertion inside the
framework is undesirable. The non-asserting API allows a designer to
request a safety-margin when allocating or posting an event. The event
is not allocated/posted if the safety margin cannot be satisfied at the
time of the call. On the other hand, the safety margin allows the
application to still use the regular (asserting) event allocation and
posting, because the event pools and event queues are guaranteed to
maintain a minimal margin for safe operation.
Finally, this QP/C++ release brings significant improvements to the QS
software tracing implementation and also brings important changes the
ARM Cortex-M port. Changes in detail are as follows:
0. Removed the conditional compilation of the QP:: namespace b ... ...
近期下载者:
相关文件:
收藏者: