OpenCores
URL https://opencores.org/ocsvn/fwrisc/fwrisc/trunk

Subversion Repositories fwrisc

[/] [fwrisc/] [trunk/] [ve/] [fwrisc_fpga/] [tests/] [fwrisc_fpga_tests.h] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 mballance
/*
2
 * fwrisc_fpga_tests.h
3
 *
4
 *  Created on: Nov 21, 2018
5
 *      Author: ballance
6
 */
7
 
8
#ifndef INCLUDED_FWRISC_FPGA_TESTS_H
9
#define INCLUDED_FWRISC_FPGA_TESTS_H
10
#include "Vfwrisc_fpga_tb_hdl.h"
11
#include "GoogletestVlTest.h"
12
#include "ElfSymtabReader.h"
13
#include <stack>
14
#include <set>
15
#include <string>
16
#include <functional>
17
 
18
class fwrisc_fpga_tests : public GoogletestVlTest<Vfwrisc_fpga_tb_hdl> {
19
public:
20
        fwrisc_fpga_tests();
21
 
22
        virtual ~fwrisc_fpga_tests();
23
 
24
        virtual void SetUp();
25
 
26
        virtual void regwrite(uint32_t raddr, uint32_t rdata);
27
 
28
        virtual void exec(uint32_t addr, uint32_t instr);
29
 
30
        virtual void memwrite(uint32_t addr, uint8_t mask, uint32_t data);
31
 
32
        virtual void led(uint8_t led0, uint8_t led1);
33
 
34
        void filter_func(const std::string &func) { m_filter_funcs.insert(func); }
35
 
36
public:
37
        static fwrisc_fpga_tests                *test;
38
 
39
protected:
40
        ElfSymtabReader                                                                         m_symtab;
41
 
42
        bool                                                                                            m_trace_funcs;
43
        bool                                                                                            m_trace_instr;
44
 
45
        std::stack<std::pair<Elf32_Addr,Elf32_Addr>>            m_call_stack;
46
        std::set<std::string>                                                           m_filter_funcs;
47
        std::string                                                                                     m_indent;
48
        std::function<void (uint8_t,uint8_t)>                           m_led;
49
};
50
 
51
#endif /* INCLUDED_FWRISC_FPGA_TESTS_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.