Line | |
---|
1 | /*! @file Target_lm32.cc |
---|
2 | * @brief Target_lm32 Implementation |
---|
3 | * |
---|
4 | * This file contains the implementation of the base class for |
---|
5 | * functions supporting target unique functionallity. |
---|
6 | */ |
---|
7 | #include "Target_lm32.h" |
---|
8 | #include <stdio.h> |
---|
9 | #include <stdlib.h> |
---|
10 | #include <string.h> |
---|
11 | #include <unistd.h> |
---|
12 | #include <algorithm> |
---|
13 | |
---|
14 | namespace Target { |
---|
15 | |
---|
16 | // http://www.latticesemi.com/documents/doc20890x45.pdf |
---|
17 | Target_lm32::Target_lm32( std::string targetName ): |
---|
18 | TargetBase( targetName ) |
---|
19 | { |
---|
20 | conditionalBranchInstructions.push_back("be"); |
---|
21 | conditionalBranchInstructions.push_back("bge"); |
---|
22 | conditionalBranchInstructions.push_back("bgeu"); |
---|
23 | conditionalBranchInstructions.push_back("bg"); |
---|
24 | conditionalBranchInstructions.push_back("bgu"); |
---|
25 | conditionalBranchInstructions.push_back("bne"); |
---|
26 | } |
---|
27 | |
---|
28 | Target_lm32::~Target_lm32() |
---|
29 | { |
---|
30 | } |
---|
31 | |
---|
32 | bool Target_lm32::isNopLine( |
---|
33 | const char* const line, |
---|
34 | int& size |
---|
35 | ) |
---|
36 | { |
---|
37 | if (!strcmp( &line[strlen(line)-3], "nop")) { |
---|
38 | size = 4; |
---|
39 | return true; |
---|
40 | } |
---|
41 | |
---|
42 | return false; |
---|
43 | } |
---|
44 | |
---|
45 | TargetBase *Target_lm32_Constructor( |
---|
46 | std::string targetName |
---|
47 | ) |
---|
48 | { |
---|
49 | return new Target_lm32( targetName ); |
---|
50 | } |
---|
51 | |
---|
52 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.