This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef struct circular_buffer | |
{ | |
void *buffer; // data buffer | |
void *buffer_end; // end of data buffer | |
size_t capacity; // maximum number of items in the buffer | |
size_t count; // number of items in the buffer | |
size_t sz; // size of each item in the buffer | |
void *head; // pointer to head | |
void *tail; // pointer to tail | |
} circular_buffer; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package freq2_tony; | |
/** | |
* We must organize the computation so that all entries that we need are filled in prior to using | |
* them in subsequent computations. | |
*/ | |
import java.util.*; | |
/** | |
* 今天听了段公子的DP, 里面经典的2D->1D DP优化的第一题就是coin change. 这对于理解distinct subsequence帮助很大. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
import java.lang.*; | |
import java.io.*; | |
class dmem | |
{ | |
public static void main(String []args){ | |
System.out.println("Hello World"); | |
for(int i=1; i<65; i++){ | |
System.out.println(String.format("%32s", Integer.toBinaryString(i)).replace(' ', '0')); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* SocialLedge.com - Copyright (C) 2013 | |
* | |
* This file is part of free software framework for embedded processors. | |
* You can use it and/or distribute it as long as this copyright header | |
* remains unmodified. The code is free for personal use and requires | |
* permission to use in a commercial product. | |
* | |
* THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED | |
* OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GUIDANCE | |
Add coverage from cur_pkt inside the monitor | |
Items: length, packet_kind | |
Transition: length | |
SYNTAX | |
Reference fields from struct | |
item ITEM_NAME : TYPE = OBJECT_NAME.FIELD_NAME; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GUIDANCE | |
Use when sub typing to connect to the right signals of the signal map. | |
A new enum was added to identify the port (value is controlled during | |
generation). | |
Use the port_name field (which is of this new enum type) to select | |
which signals of the smp the signals of the monitor need to be | |
connected to. See example for the IN packet_monitor_u for reference |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GUIDANCE | |
Recreate/reconstruct a packet_s from list of bytes collected | |
- complete the recreate_pkt() method below | |
- pull proper values from the list | |
<' | |
unit packet_monitor_u{ | |
!smp: router_signal_map_u; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GUIDANCE | |
Fill in TCM to collect packet information from DUT | |
<' | |
unit packet_monitor_u { | |
!smp: router_signal_map_u; | |
!cur_pkt: packet_s; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GUIDANCE | |
1. Instantiate signal map - name it smp | |
2. Print value of valid, data, suspend of ouput port 0 | |
by referencing signal map | |
SYNTAX | |
Do not randomize signal map unit | |
!map_instance_name: map_def_name_u; |
NewerOlder